From 8d4c114d21e6a512645bada9528be4c6b7328cb5 Mon Sep 17 00:00:00 2001 From: Sarah-Jaine Szekeresh Date: Thu, 19 Nov 2020 11:10:05 -0600 Subject: [PATCH 1/5] add service instance --- terraform/dev/main.tf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/terraform/dev/main.tf b/terraform/dev/main.tf index 82742eff27..dbd6f60b81 100644 --- a/terraform/dev/main.tf +++ b/terraform/dev/main.tf @@ -52,3 +52,17 @@ resource "cloudfoundry_service_instance" "database" { space = data.cloudfoundry_space.space.id service_plan = data.cloudfoundry_service.rds.service_plans["micro-psql"] } + +### +# S3 bucket +### + +data "cloudfoundry_service" "s3" { + name = "s3" +} + +resource "cloudfoundry_service_instance" "document_upload_bucket" { + name = "ttahub-document-upload-${var.env}" + space = data.cloudfoundry_space.space.id + service_plan = data.cloudfoundry_service.s3.service_plans["basic"] +} From c353ef0cfd32457fddef6464e3a76a0d50e5135d Mon Sep 17 00:00:00 2001 From: Sarah-Jaine Szekeresh Date: Fri, 20 Nov 2020 13:19:09 -0600 Subject: [PATCH 2/5] add binding --- deployment_config/dev_vars.yml | 1 + deployment_config/prod_vars.yml | 1 + deployment_config/sandbox_vars.yml | 1 + deployment_config/staging_vars.yml | 1 + manifest.yml | 2 ++ 5 files changed, 6 insertions(+) diff --git a/deployment_config/dev_vars.yml b/deployment_config/dev_vars.yml index 8081cf49b0..10fab6ad29 100644 --- a/deployment_config/dev_vars.yml +++ b/deployment_config/dev_vars.yml @@ -8,3 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-dev.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-dev.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) +S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-dev diff --git a/deployment_config/prod_vars.yml b/deployment_config/prod_vars.yml index 80d91a2512..7e68291d8b 100644 --- a/deployment_config/prod_vars.yml +++ b/deployment_config/prod_vars.yml @@ -8,3 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-prod.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-prod.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) +S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-prod diff --git a/deployment_config/sandbox_vars.yml b/deployment_config/sandbox_vars.yml index 4b921f082f..2ca6b99748 100644 --- a/deployment_config/sandbox_vars.yml +++ b/deployment_config/sandbox_vars.yml @@ -8,3 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-sandbox.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-sandbox.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) +S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-sandbox diff --git a/deployment_config/staging_vars.yml b/deployment_config/staging_vars.yml index 5f615245f0..796f168c30 100644 --- a/deployment_config/staging_vars.yml +++ b/deployment_config/staging_vars.yml @@ -8,3 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-staging.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-staging.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) +S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-staging diff --git a/manifest.yml b/manifest.yml index f658ef2603..b1029644c2 100644 --- a/manifest.yml +++ b/manifest.yml @@ -12,3 +12,5 @@ applications: REDIRECT_URI_HOST: ((REDIRECT_URI_HOST)) TTA_SMART_HUB_URI: ((TTA_SMART_HUB_URI)) SESSION_SECRET: ((SESSION_SECRET)) + services: + - (( S3_DOC_UPLOAD_BUCKET )) From 5fabfc894272146a1d9483c2534c60298f2bfb69 Mon Sep 17 00:00:00 2001 From: Sarah-Jaine Szekeresh Date: Fri, 20 Nov 2020 14:10:27 -0600 Subject: [PATCH 3/5] correct service binding --- .circleci/config.yml | 2 +- deployment_config/dev_vars.yml | 2 +- deployment_config/prod_vars.yml | 2 +- deployment_config/sandbox_vars.yml | 2 +- deployment_config/staging_vars.yml | 2 +- manifest.yml | 29 +++++++++++++++-------------- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b1a1d2a590..b1ddd03359 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,7 +109,7 @@ parameters: default: "main" type: string sandbox_git_branch: # change to feature branch to test deployment - default: "js-128-add-multiselect-component" + default: "sj-tf-s3-init" type: string jobs: build: diff --git a/deployment_config/dev_vars.yml b/deployment_config/dev_vars.yml index 10fab6ad29..4825e8b8c0 100644 --- a/deployment_config/dev_vars.yml +++ b/deployment_config/dev_vars.yml @@ -8,4 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-dev.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-dev.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) -S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-dev +s3_doc_upload_bucket: ttahub-document-upload-dev diff --git a/deployment_config/prod_vars.yml b/deployment_config/prod_vars.yml index 7e68291d8b..be1c57c5ff 100644 --- a/deployment_config/prod_vars.yml +++ b/deployment_config/prod_vars.yml @@ -8,4 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-prod.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-prod.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) -S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-prod +s3_doc_upload_bucket: ttahub-document-upload-prod diff --git a/deployment_config/sandbox_vars.yml b/deployment_config/sandbox_vars.yml index 2ca6b99748..04c303b415 100644 --- a/deployment_config/sandbox_vars.yml +++ b/deployment_config/sandbox_vars.yml @@ -8,4 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-sandbox.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-sandbox.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) -S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-sandbox +s3_doc_upload_bucket: ttahub-document-upload-sandbox diff --git a/deployment_config/staging_vars.yml b/deployment_config/staging_vars.yml index 796f168c30..424724531a 100644 --- a/deployment_config/staging_vars.yml +++ b/deployment_config/staging_vars.yml @@ -8,4 +8,4 @@ NODE_ENV: production REDIRECT_URI_HOST: https://tta-smarthub-staging.app.cloud.gov TTA_SMART_HUB_URI: https://tta-smarthub-staging.app.cloud.gov SESSION_SECRET: ((SESSION_SECRET)) -S3_DOC_UPLOAD_BUCKET: ttahub-document-upload-staging +s3_doc_upload_bucket: ttahub-document-upload-staging diff --git a/manifest.yml b/manifest.yml index b1029644c2..785bfcccda 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,16 +1,17 @@ --- applications: -- name: tta-smarthub-((env)) - instances: ((instances)) - command: yarn start - env: - AUTH_BASE: ((AUTH_BASE)) - AUTH_CLIENT_ID: ((AUTH_CLIENT_ID)) - AUTH_CLIENT_SECRET: ((AUTH_CLIENT_SECRET)) - NODE_ENV: ((NODE_ENV)) - # Soon to be removed in favor of TTA_SMART_HUB_URI - REDIRECT_URI_HOST: ((REDIRECT_URI_HOST)) - TTA_SMART_HUB_URI: ((TTA_SMART_HUB_URI)) - SESSION_SECRET: ((SESSION_SECRET)) - services: - - (( S3_DOC_UPLOAD_BUCKET )) + - name: tta-smarthub-((env)) + instances: ((instances)) + command: yarn start + env: + AUTH_BASE: ((AUTH_BASE)) + AUTH_CLIENT_ID: ((AUTH_CLIENT_ID)) + AUTH_CLIENT_SECRET: ((AUTH_CLIENT_SECRET)) + NODE_ENV: ((NODE_ENV)) + # Soon to be removed in favor of TTA_SMART_HUB_URI + REDIRECT_URI_HOST: ((REDIRECT_URI_HOST)) + SESSION_SECRET: ((SESSION_SECRET)) + TTA_SMART_HUB_URI: ((TTA_SMART_HUB_URI)) + services: + - ((rds_instance)) + - ((s3_doc_upload_bucket)) From ad03ba5506463ad1fd65b22c8b2547bba88fbceb Mon Sep 17 00:00:00 2001 From: Sarah-Jaine Szekeresh Date: Fri, 20 Nov 2020 14:13:09 -0600 Subject: [PATCH 4/5] add bucket to sand, stag, prod --- terraform/prod/main.tf | 14 ++++++++++++++ terraform/sandbox/main.tf | 14 ++++++++++++++ terraform/staging/main.tf | 14 ++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/terraform/prod/main.tf b/terraform/prod/main.tf index a42253239f..5103a02072 100644 --- a/terraform/prod/main.tf +++ b/terraform/prod/main.tf @@ -52,3 +52,17 @@ resource "cloudfoundry_service_instance" "database" { space = data.cloudfoundry_space.space.id service_plan = data.cloudfoundry_service.rds.service_plans["small-psql"] } + +### +# S3 bucket +### + +data "cloudfoundry_service" "s3" { + name = "s3" +} + +resource "cloudfoundry_service_instance" "document_upload_bucket" { + name = "ttahub-document-upload-${var.env}" + space = data.cloudfoundry_space.space.id + service_plan = data.cloudfoundry_service.s3.service_plans["basic"] +} diff --git a/terraform/sandbox/main.tf b/terraform/sandbox/main.tf index aeb4a3d1d1..7f13608834 100644 --- a/terraform/sandbox/main.tf +++ b/terraform/sandbox/main.tf @@ -52,3 +52,17 @@ resource "cloudfoundry_service_instance" "database" { space = data.cloudfoundry_space.space.id service_plan = data.cloudfoundry_service.rds.service_plans["micro-psql"] } + +### +# S3 bucket +### + +data "cloudfoundry_service" "s3" { + name = "s3" +} + +resource "cloudfoundry_service_instance" "document_upload_bucket" { + name = "ttahub-document-upload-${var.env}" + space = data.cloudfoundry_space.space.id + service_plan = data.cloudfoundry_service.s3.service_plans["basic"] +} diff --git a/terraform/staging/main.tf b/terraform/staging/main.tf index 7f93fcd972..9e3318baac 100644 --- a/terraform/staging/main.tf +++ b/terraform/staging/main.tf @@ -52,3 +52,17 @@ resource "cloudfoundry_service_instance" "database" { space = data.cloudfoundry_space.space.id service_plan = data.cloudfoundry_service.rds.service_plans["micro-psql"] } + +### +# S3 bucket +### + +data "cloudfoundry_service" "s3" { + name = "s3" +} + +resource "cloudfoundry_service_instance" "document_upload_bucket" { + name = "ttahub-document-upload-${var.env}" + space = data.cloudfoundry_space.space.id + service_plan = data.cloudfoundry_service.s3.service_plans["basic"] +} From bb6ab232207b824d67898bb5c8f40deb6500924c Mon Sep 17 00:00:00 2001 From: Sarah-Jaine Szekeresh Date: Fri, 20 Nov 2020 14:14:19 -0600 Subject: [PATCH 5/5] take out rds bind --- manifest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.yml b/manifest.yml index 785bfcccda..7ff534d555 100644 --- a/manifest.yml +++ b/manifest.yml @@ -13,5 +13,4 @@ applications: SESSION_SECRET: ((SESSION_SECRET)) TTA_SMART_HUB_URI: ((TTA_SMART_HUB_URI)) services: - - ((rds_instance)) - ((s3_doc_upload_bucket))