Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform: Create S3 bucket for doc upload #72

Merged
merged 8 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ parameters:
default: "main"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "sj-bind-rds"
default: "sj-tf-s3-init"
type: string
jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions deployment_config/dev_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ NODE_ENV: production
# This env variable should go away soon in favor of TTA_SMART_HUB_URI
REDIRECT_URI_HOST: https://tta-smarthub-dev.app.cloud.gov
rds_instance: ttahub-dev
s3_doc_upload_bucket: ttahub-document-upload-dev
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-dev.app.cloud.gov
1 change: 1 addition & 0 deletions deployment_config/prod_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ NODE_ENV: production
# This env variable should go away soon in favor of TTA_SMART_HUB_URI
REDIRECT_URI_HOST: https://tta-smarthub-prod.app.cloud.gov
rds_instance: ttahub-prod
s3_doc_upload_bucket: ttahub-document-upload-prod
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-prod.app.cloud.gov
1 change: 1 addition & 0 deletions deployment_config/sandbox_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ NODE_ENV: production
# This env variable should go away soon in favor of TTA_SMART_HUB_URI
REDIRECT_URI_HOST: https://tta-smarthub-sandbox.app.cloud.gov
rds_instance: ttahub-sandbox
s3_doc_upload_bucket: ttahub-document-upload-sandbox
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-sandbox.app.cloud.gov
1 change: 1 addition & 0 deletions deployment_config/staging_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ NODE_ENV: production
# This env variable should go away soon in favor of TTA_SMART_HUB_URI
REDIRECT_URI_HOST: https://tta-smarthub-staging.app.cloud.gov
rds_instance: ttahub-staging
s3_doc_upload_bucket: ttahub-document-upload-staging
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-staging.app.cloud.gov
3 changes: 2 additions & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ applications:
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))
TTA_SMART_HUB_URI: ((TTA_SMART_HUB_URI))
services:
- ((rds_instance))
- ((s3_doc_upload_bucket))
14 changes: 14 additions & 0 deletions terraform/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

SarahJaine marked this conversation as resolved.
Show resolved Hide resolved
###
# 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"]
}
14 changes: 14 additions & 0 deletions terraform/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
14 changes: 14 additions & 0 deletions terraform/sandbox/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
14 changes: 14 additions & 0 deletions terraform/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}