Skip to content

Commit

Permalink
CD: Bind RDS instance (#71)
Browse files Browse the repository at this point in the history
* bind RDS_INSTANCE via manifest

* add sandbox bind

* alpha

* maybe cloud.gov docs are wrong

* try two spaces

* match syntax of 18f ex

* Add documentation

Co-authored-by: Sarah-Jaine Szekeresh <[email protected]>
  • Loading branch information
SarahJaine and SarahJaine authored Nov 23, 2020
1 parent 676eeed commit f7c66d3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
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: "js-128-add-multiselect-component"
default: "sj-bind-rds"
type: string
jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion deployment_config/dev_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ instances: 1
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
TTA_SMART_HUB_URI: https://tta-smarthub-dev.app.cloud.gov
rds_instance: ttahub-dev
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-dev.app.cloud.gov
3 changes: 2 additions & 1 deletion deployment_config/prod_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ instances: 2
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
TTA_SMART_HUB_URI: https://tta-smarthub-prod.app.cloud.gov
rds_instance: ttahub-prod
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-prod.app.cloud.gov
3 changes: 2 additions & 1 deletion deployment_config/sandbox_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ instances: 1
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
TTA_SMART_HUB_URI: https://tta-smarthub-sandbox.app.cloud.gov
rds_instance: ttahub-sandbox
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-sandbox.app.cloud.gov
3 changes: 2 additions & 1 deletion deployment_config/staging_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ instances: 1
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
TTA_SMART_HUB_URI: https://tta-smarthub-staging.app.cloud.gov
rds_instance: ttahub-staging
SESSION_SECRET: ((SESSION_SECRET))
TTA_SMART_HUB_URI: https://tta-smarthub-staging.app.cloud.gov
26 changes: 14 additions & 12 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
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))
- 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:
- ((rds_instance))
5 changes: 5 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,18 @@ _Tip: You run terraform files from the directory in which they are stored. For e
```bash
terraform apply
```
1. **Bind the infrastructure to the application**
CloudFoundry/cloud.gov requires that some "services" (e.g. AWS infrastructure) be "bound" to the application instance. S3, Redis, and Elasticsearch are all services that require this "binding" step. See the [cloud.gov documentation][cloudgov-bind] for more direction on this. Also, check out [PR#71][PR#71] for an example of how this was done for the RDS instances.
<!-- Links -->
[aws-config]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config
[aws-install]: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
[cloudgov-bind]: https://cloud.gov/docs/deployment/managed-services/#bind-the-service-instance
[cloudgov-deployer]: https://cloud.gov/docs/services/cloud-gov-service-account/
[cloudgov-service-keys]: https://cloud.gov/docs/services/s3/#interacting-with-your-s3-bucket-from-outside-cloudgov
[cf-install]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html
[PR#71]: https://github.com/adhocteam/Head-Start-TTADP/pull/71
[tf]: https://www.terraform.io/downloads.html
[tf-vars]: https://www.terraform.io/docs/configuration/variables.html#variable-definitions-tfvars-files

0 comments on commit f7c66d3

Please sign in to comment.