Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
feat: migrating TF state to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
katerinachinnappan committed Apr 17, 2024
1 parent b8faf30 commit 87b231e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .aws/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.7
1.6.6
11 changes: 6 additions & 5 deletions .aws/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Construct } from 'constructs';
import {
App,
DataTerraformRemoteState,
RemoteBackend,
S3Backend,
TerraformStack,
} from 'cdktf';
import { AwsProvider } from '@cdktf/provider-aws/lib/provider';
Expand Down Expand Up @@ -30,10 +30,11 @@ class BrazeContentProxy extends TerraformStack {
new LocalProvider(this, 'local_provider');
new NullProvider(this, 'null_provider');

new RemoteBackend(this, {
hostname: 'app.terraform.io',
organization: 'Pocket',
workspaces: [{ prefix: `${config.name}-` }],
new S3Backend(this, {
bucket: `mozilla-content-team-${config.environment.toLowerCase()}-terraform-state`,
dynamodbTable: `mozilla-content-team-${config.environment.toLowerCase()}-terraform-state`,
key: config.name,
region: 'us-east-1',
});

const region = new DataAwsRegion(this, 'region');
Expand Down
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ phases:
# synthesize the js into terraform json with the proper node environment
- 'if [ "$GIT_BRANCH" = "$DEV_BRANCH" ]; then NODE_ENV=development npm run synth; else npm run synth; fi'
- cd cdktf.out/stacks/braze-content-proxy
- terraform init
- 'if [ "$GIT_BRANCH" = "$DEV_BRANCH" ]; then TF_WORKSPACE=$TF_DEV_WORKSPACE terraform init; else terraform init; fi'
build:
run-as: circleci
commands:
Expand Down

0 comments on commit 87b231e

Please sign in to comment.