diff --git a/.aws/.terraform-version b/.aws/.terraform-version index 524cb552..ec70f755 100644 --- a/.aws/.terraform-version +++ b/.aws/.terraform-version @@ -1 +1 @@ -1.1.1 +1.6.6 diff --git a/.aws/src/main.ts b/.aws/src/main.ts index 0b80f30c..f5db0bee 100644 --- a/.aws/src/main.ts +++ b/.aws/src/main.ts @@ -2,7 +2,7 @@ import { Construct } from 'constructs'; import { App, DataTerraformRemoteState, - RemoteBackend, + S3Backend, TerraformStack, } from 'cdktf'; import { PagerdutyProvider } from '@cdktf/provider-pagerduty/lib/provider'; @@ -36,16 +36,12 @@ class FirefoxAndroidHomeRecommendations 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 incidentManagement = new DataTerraformRemoteState( this, 'incident_management', diff --git a/buildspec.yml b/buildspec.yml index 71390c30..b4a72065 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -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/firefox-android-home-recommendations - - terraform init + - 'if [ "$GIT_BRANCH" = "$DEV_BRANCH" ]; then TF_WORKSPACE=$TF_DEV_WORKSPACE terraform init; else terraform init; fi' build: run-as: circleci commands: