Skip to content

Commit

Permalink
chore: Update Terraform tags to use "ManagedBy" instead of "Terraform…
Browse files Browse the repository at this point in the history
…" in staging.tfvars and prod.tfvars
  • Loading branch information
ulises-jeremias committed Jul 3, 2024
1 parent faeab93 commit d71fe5f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 9 deletions.
2 changes: 1 addition & 1 deletion live/common-infra/configs/staging.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace = "nan"
environment = "staging"
tags = {
"ManagedBy" = "Terraform"
"Environment" = "prod"
"Environment" = "staging"
}

# Core Networking settings
Expand Down
2 changes: 1 addition & 1 deletion live/core-networking/configs/staging.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace = "nan"
environment = "staging"
tags = {
"ManagedBy" = "Terraform"
"Environment" = "prod"
"Environment" = "staging"
}

# AWS settings
Expand Down
6 changes: 3 additions & 3 deletions live/terraform-backend/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ module "terraform_state_backend" {
stage = var.stage
attributes = ["state"]

terraform_backend_config_file_path = "."
terraform_backend_config_file_name = "s3-backend.tf"
terraform_backend_config_file_path = "./configs"
terraform_backend_config_file_name = "${var.environment}-backend.tfvars"
terraform_state_file = "${module.label.id}.tfstate"

bucket_enabled = true
dynamodb_enabled = true
dynamodb_enabled = false

force_destroy = false
}
22 changes: 22 additions & 0 deletions live/terraform-backend/common-infra-backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# You cannot create a new backend by simply defining this and then
# immediately proceeding to "terraform apply". The S3 backend must
# be bootstrapped according to the simple yet essential procedure in
# https://github.com/cloudposse/terraform-aws-tfstate-backend#usage
module "terraform_state_backend" {
source = "cloudposse/tfstate-backend/aws"
version = "1.1.1"

name = "common-infra"
namespace = var.namespace
environment = var.environment
attributes = ["state"]

terraform_backend_config_file_path = "../common-infra"
terraform_backend_config_file_name = "${var.environment}-backend.tfvars"
terraform_state_file = "${var.namespace}-common-infra-${var.environment}.tfstate"

bucket_enabled = true
dynamodb_enabled = true

force_destroy = false
}
2 changes: 1 addition & 1 deletion live/terraform-backend/configs/prod.tfvars
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# General settings

region = "us-west-2"
name = "common-infra-tf-backend"
name = "tf-backend"
namespace = "nan"
environment = "prod"
tags = {
Expand Down
6 changes: 3 additions & 3 deletions live/terraform-backend/configs/staging.tfvars
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# General settings

region = "us-west-2"
name = "common-infra-tf-backend"
name = "infra-tf-backend"
namespace = "nan"
environment = "prod"
environment = "staging"
tags = {
"ManagedBy" = "Terraform"
"Environment" = "prod"
"Environment" = "staging"
}
22 changes: 22 additions & 0 deletions live/terraform-backend/core-networking-backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# You cannot create a new backend by simply defining this and then
# immediately proceeding to "terraform apply". The S3 backend must
# be bootstrapped according to the simple yet essential procedure in
# https://github.com/cloudposse/terraform-aws-tfstate-backend#usage
module "terraform_state_backend" {
source = "cloudposse/tfstate-backend/aws"
version = "1.1.1"

name = "core-networking"
namespace = var.namespace
environment = var.environment
attributes = ["state"]

terraform_backend_config_file_path = "../core-networking"
terraform_backend_config_file_name = "${var.environment}-backend.tfvars"
terraform_state_file = "${var.namespace}-core-networking-${var.environment}.tfstate"

bucket_enabled = true
dynamodb_enabled = true

force_destroy = false
}

0 comments on commit d71fe5f

Please sign in to comment.