Skip to content

Commit

Permalink
refactor: take down staging
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Mar 2, 2024
1 parent 026e9ae commit 9092d88
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 41 deletions.
2 changes: 1 addition & 1 deletion infra/tf/staging/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
bucket = "darklab-eu-west-1-global-terraform-state"
dynamodb_table = "darklab-eu-west-1-global-terraform-state"
encrypt = true
key = "github.com/darklab8/fl-darkbot.staging.tfstate"
key = "darkbot.staging.tfstate"
region = "eu-west-1"
}
}
61 changes: 21 additions & 40 deletions infra/tf/staging/main.tf
Original file line number Diff line number Diff line change
@@ -1,51 +1,32 @@
module "stack" {
source = "../modules/hetzner_server"
environment = "staging"
server_power = "cpx21"
backups = false
}
# module "stack" {
# source = "../modules/hetzner_server"
# environment = "staging"
# server_power = "cpx21"
# backups = false
# }

output "cluster_ip" {
value = module.stack.cluster_ip
}
# output "cluster_ip" {
# value = module.stack.cluster_ip
# }

provider "docker" {
host = "ssh://root@${module.stack.cluster_ip}:22"
ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "~/.ssh/id_rsa.darklab"]
}
# provider "docker" {
# host = "ssh://root@${module.stack.cluster_ip}:22"
# ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "~/.ssh/id_rsa.darklab"]
# }

data "aws_ssm_parameter" "github.com/darklab8/fl-darkbot" {
data "aws_ssm_parameter" "darkbot" {
name = "/terraform/hetzner/darkbot/staging"
}

locals {
secrets = nonsensitive(jsondecode(data.aws_ssm_parameter.darkbot.value))
}

module "github.com/darklab8/fl-darkbot" {
source = "../modules/darkbot"
configurator_dbname = "staging"
consoler_prefix = ","
secrets = local.secrets
tag_version = "v1.5.0"
debug = false
}

# # Create a docker image resource
# # -> docker pull nginx:latest
# resource "docker_image" "nginx" {
# name = "nginx:latest"
# keep_locally = true
# }

# # Create a docker container resource
# # -> same as 'docker run --name nginx -p8080:80 -d nginx:latest'
# resource "docker_container" "nginx" {
# name = "nginx"
# image = docker_image.nginx.image_id

# ports {
# external = 8080
# internal = 80
# }
# module "darkbot" {
# source = "../modules/darkbot"
# configurator_dbname = "staging"
# consoler_prefix = ","
# secrets = local.secrets
# tag_version = "v1.5.0"
# debug = false
# }

0 comments on commit 9092d88

Please sign in to comment.