From 2a6b69ab45b5254a2680f75beb846c005a343aaf Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Mon, 10 Jun 2024 11:54:32 -0700 Subject: [PATCH 1/2] Upgrade terraform-cloudgov, remove recursive_delete, add prevent_destroy --- terraform/demo/main.tf | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/terraform/demo/main.tf b/terraform/demo/main.tf index 615f92670..1a96c5e4a 100644 --- a/terraform/demo/main.tf +++ b/terraform/demo/main.tf @@ -3,35 +3,40 @@ locals { cf_space_name = "notify-demo" env = "demo" app_name = "notify-api" - recursive_delete = false + recursive_delete = false # deprecated, still used in shared modules +} + + +resource "null_resource" "prevent_destroy" { + + lifecycle { + prevent_destroy = true + } } module "database" { - source = "github.com/18f/terraform-cloudgov//database?ref=v0.7.1" + source = "github.com/GSA-TTS/terraform-cloudgov//database?ref=v1.0.0" cf_org_name = local.cf_org_name cf_space_name = local.cf_space_name name = "${local.app_name}-rds-${local.env}" - recursive_delete = local.recursive_delete rds_plan_name = "micro-psql" } module "redis" { - source = "github.com/18f/terraform-cloudgov//redis?ref=v0.7.1" + source = "github.com/GSA-TTS/terraform-cloudgov//redis?ref=v1.0.0" cf_org_name = local.cf_org_name cf_space_name = local.cf_space_name name = "${local.app_name}-redis-${local.env}" - recursive_delete = local.recursive_delete redis_plan_name = "redis-dev" } module "csv_upload_bucket" { - source = "github.com/18f/terraform-cloudgov//s3?ref=v0.7.1" + source = "github.com/GSA-TTS/terraform-cloudgov//s3?ref=v1.0.0" cf_org_name = local.cf_org_name cf_space_name = local.cf_space_name - recursive_delete = local.recursive_delete name = "${local.app_name}-csv-upload-bucket-${local.env}" } @@ -52,7 +57,6 @@ module "ses_email" { cf_org_name = local.cf_org_name cf_space_name = local.cf_space_name name = "${local.app_name}-ses-${local.env}" - recursive_delete = local.recursive_delete aws_region = "us-west-2" email_domain = "notify.sandbox.10x.gsa.gov" email_receipt_error = "notify-support@gsa.gov" @@ -64,7 +68,6 @@ module "sns_sms" { cf_org_name = local.cf_org_name cf_space_name = local.cf_space_name name = "${local.app_name}-sns-${local.env}" - recursive_delete = local.recursive_delete aws_region = "us-east-1" monthly_spend_limit = 25 } From a580368ccee3d3f143d294ea98ccbffdbd366707 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Mon, 10 Jun 2024 11:57:49 -0700 Subject: [PATCH 2/2] Terraform fmt --- terraform/demo/main.tf | 22 +++++++++++----------- terraform/sandbox/main.tf | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/terraform/demo/main.tf b/terraform/demo/main.tf index 1a96c5e4a..9b933c409 100644 --- a/terraform/demo/main.tf +++ b/terraform/demo/main.tf @@ -17,27 +17,27 @@ resource "null_resource" "prevent_destroy" { module "database" { source = "github.com/GSA-TTS/terraform-cloudgov//database?ref=v1.0.0" - cf_org_name = local.cf_org_name - cf_space_name = local.cf_space_name - name = "${local.app_name}-rds-${local.env}" - rds_plan_name = "micro-psql" + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + name = "${local.app_name}-rds-${local.env}" + rds_plan_name = "micro-psql" } module "redis" { source = "github.com/GSA-TTS/terraform-cloudgov//redis?ref=v1.0.0" - cf_org_name = local.cf_org_name - cf_space_name = local.cf_space_name - name = "${local.app_name}-redis-${local.env}" - redis_plan_name = "redis-dev" + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + name = "${local.app_name}-redis-${local.env}" + redis_plan_name = "redis-dev" } module "csv_upload_bucket" { source = "github.com/GSA-TTS/terraform-cloudgov//s3?ref=v1.0.0" - cf_org_name = local.cf_org_name - cf_space_name = local.cf_space_name - name = "${local.app_name}-csv-upload-bucket-${local.env}" + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + name = "${local.app_name}-csv-upload-bucket-${local.env}" } module "egress-space" { diff --git a/terraform/sandbox/main.tf b/terraform/sandbox/main.tf index cc99b033b..cf7f95e29 100644 --- a/terraform/sandbox/main.tf +++ b/terraform/sandbox/main.tf @@ -9,27 +9,27 @@ locals { module "database" { source = "github.com/GSA-TTS/terraform-cloudgov//database?ref=v1.0.0" - cf_org_name = local.cf_org_name - cf_space_name = local.cf_space_name - name = "${local.app_name}-rds-${local.env}" - rds_plan_name = "micro-psql" + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + name = "${local.app_name}-rds-${local.env}" + rds_plan_name = "micro-psql" } module "redis" { source = "github.com/GSA-TTS/terraform-cloudgov//redis?ref=v1.0.0" - cf_org_name = local.cf_org_name - cf_space_name = local.cf_space_name - name = "${local.app_name}-redis-${local.env}" - redis_plan_name = "redis-dev" + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + name = "${local.app_name}-redis-${local.env}" + redis_plan_name = "redis-dev" } module "csv_upload_bucket" { source = "github.com/GSA-TTS/terraform-cloudgov//s3?ref=v1.0.0" - cf_org_name = local.cf_org_name - cf_space_name = local.cf_space_name - name = "${local.app_name}-csv-upload-bucket-${local.env}" + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + name = "${local.app_name}-csv-upload-bucket-${local.env}" } module "egress-space" {