From 90b5261821e33b6f3d3edbd0c7808f242f43de6f Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Tue, 1 Nov 2022 12:22:20 -0400 Subject: [PATCH] Update terraform for new org and space names --- terraform/bootstrap/main.tf | 4 ++-- terraform/bootstrap/run.sh | 2 +- terraform/bootstrap/teardown_creds.sh | 2 +- terraform/bootstrap/variables.tf | 4 +++- terraform/production/main.tf | 30 +++++++++++++++++++++++---- terraform/production/providers.tf | 2 +- terraform/production/variables.tf | 4 +++- terraform/staging/main.tf | 4 ++-- terraform/staging/providers.tf | 2 +- terraform/staging/variables.tf | 4 +++- 10 files changed, 43 insertions(+), 15 deletions(-) diff --git a/terraform/bootstrap/main.tf b/terraform/bootstrap/main.tf index f00fff4c5..f51d5bd2d 100644 --- a/terraform/bootstrap/main.tf +++ b/terraform/bootstrap/main.tf @@ -9,8 +9,8 @@ module "s3" { cf_api_url = local.cf_api_url cf_user = var.cf_user cf_password = var.cf_password - cf_org_name = "gsa-10x-prototyping" - cf_space_name = "10x-notifications" + cf_org_name = "gsa-tts-benefits-studio-prototyping" + cf_space_name = "notify-management" s3_service_name = local.s3_service_name } diff --git a/terraform/bootstrap/run.sh b/terraform/bootstrap/run.sh index 404987590..1ac395444 100755 --- a/terraform/bootstrap/run.sh +++ b/terraform/bootstrap/run.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [[ ! -f "secrets.auto.tfvars" ]]; then - ../create_service_account.sh -s 10x-notifications -u config-bootstrap-deployer > secrets.auto.tfvars + ../create_service_account.sh -s notify-management -u config-bootstrap-deployer > secrets.auto.tfvars fi if [[ $# -gt 0 ]]; then diff --git a/terraform/bootstrap/teardown_creds.sh b/terraform/bootstrap/teardown_creds.sh index 196e3756f..77207a69b 100755 --- a/terraform/bootstrap/teardown_creds.sh +++ b/terraform/bootstrap/teardown_creds.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -../destroy_service_account.sh -s 10x-notifications -u config-bootstrap-deployer +../destroy_service_account.sh -s notify-management -u config-bootstrap-deployer rm secrets.auto.tfvars diff --git a/terraform/bootstrap/variables.tf b/terraform/bootstrap/variables.tf index 2fe500544..a24f2f3f8 100644 --- a/terraform/bootstrap/variables.tf +++ b/terraform/bootstrap/variables.tf @@ -1,2 +1,4 @@ -variable "cf_password" {} +variable "cf_password" { + sensitive = true +} variable "cf_user" {} diff --git a/terraform/production/main.tf b/terraform/production/main.tf index 3a02bec22..7be376ba4 100644 --- a/terraform/production/main.tf +++ b/terraform/production/main.tf @@ -1,6 +1,6 @@ locals { - cf_org_name = "TKTK" - cf_space_name = "TKTK" + cf_org_name = "gsa-tts-benefits-studio-prototyping" + cf_space_name = "notify-demo" env = "production" app_name = "notifications-api" recursive_delete = false @@ -16,7 +16,7 @@ module "database" { env = local.env app_name = local.app_name recursive_delete = local.recursive_delete - rds_plan_name = "TKTK-production-rds-plan" + rds_plan_name = "micro-psql" } module "redis" { @@ -29,7 +29,29 @@ module "redis" { env = local.env app_name = local.app_name recursive_delete = local.recursive_delete - redis_plan_name = "TKTK-production-redis-plan" + redis_plan_name = "redis-dev" +} + +module "csv_upload_bucket" { + source = "github.com/18f/terraform-cloudgov//s3" + + cf_user = var.cf_user + cf_password = var.cf_password + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + recursive_delete = local.recursive_delete + s3_service_name = "${local.app_name}-csv-upload-bucket-${local.env}" +} + +module "contact_list_bucket" { + source = "github.com/18f/terraform-cloudgov//s3" + + cf_user = var.cf_user + cf_password = var.cf_password + cf_org_name = local.cf_org_name + cf_space_name = local.cf_space_name + recursive_delete = local.recursive_delete + s3_service_name = "${local.app_name}-contact-list-bucket-${local.env}" } ########################################################################### diff --git a/terraform/production/providers.tf b/terraform/production/providers.tf index 00f7c902d..b11f77c29 100644 --- a/terraform/production/providers.tf +++ b/terraform/production/providers.tf @@ -8,7 +8,7 @@ terraform { } backend "s3" { - bucket = "cg-31204bcc-aae3-4cd3-8b59-5055a338d44f" + bucket = "TKTK" key = "api.tfstate.prod" encrypt = "true" region = "us-gov-west-1" diff --git a/terraform/production/variables.tf b/terraform/production/variables.tf index 2fe500544..a24f2f3f8 100644 --- a/terraform/production/variables.tf +++ b/terraform/production/variables.tf @@ -1,2 +1,4 @@ -variable "cf_password" {} +variable "cf_password" { + sensitive = true +} variable "cf_user" {} diff --git a/terraform/staging/main.tf b/terraform/staging/main.tf index 3a81e21d5..ef7c46ffe 100644 --- a/terraform/staging/main.tf +++ b/terraform/staging/main.tf @@ -1,6 +1,6 @@ locals { - cf_org_name = "gsa-10x-prototyping" - cf_space_name = "10x-notifications" + cf_org_name = "gsa-tts-benefits-studio-prototyping" + cf_space_name = "notify-staging" env = "staging" app_name = "notifications-api" recursive_delete = true diff --git a/terraform/staging/providers.tf b/terraform/staging/providers.tf index bd8c56c11..46eaa537a 100644 --- a/terraform/staging/providers.tf +++ b/terraform/staging/providers.tf @@ -8,7 +8,7 @@ terraform { } backend "s3" { - bucket = "cg-31204bcc-aae3-4cd3-8b59-5055a338d44f" + bucket = "TKTK" key = "api.tfstate.stage" encrypt = "true" region = "us-gov-west-1" diff --git a/terraform/staging/variables.tf b/terraform/staging/variables.tf index 2fe500544..a24f2f3f8 100644 --- a/terraform/staging/variables.tf +++ b/terraform/staging/variables.tf @@ -1,2 +1,4 @@ -variable "cf_password" {} +variable "cf_password" { + sensitive = true +} variable "cf_user" {}