Skip to content

Commit

Permalink
Merge pull request #1073 from GSA/jskinne3-upgrade-and-protect-demo-m…
Browse files Browse the repository at this point in the history
…odules

Demo: upgrade terraform-cloudgov, use prevent_destroy
  • Loading branch information
ccostino authored Jun 21, 2024
2 parents 398eb22 + 7929b75 commit 83f5482
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
43 changes: 23 additions & 20 deletions terraform/demo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@ 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"
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" { # default v6.2; delete after v7.0 resource is bound
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"
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 "redis-v70" {
Expand All @@ -41,12 +47,11 @@ module "redis-v70" {
}

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}"
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" {
Expand All @@ -66,7 +71,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 = "[email protected]"
Expand All @@ -78,7 +82,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
}
22 changes: 11 additions & 11 deletions terraform/sandbox/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ 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" { # default v6.2; delete after v7.0 resource is bound
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 "redis-v70" {
Expand All @@ -48,9 +48,9 @@ module "redis-v70" {
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" {
Expand Down

0 comments on commit 83f5482

Please sign in to comment.