Part of ENG-3549. This diff sets up Terraform to use the S3 backend, located on the Terraform/Infra AWS account in the commapp-terraform bucket.
Logged in to that account, the AWS provider 'assumes role' on the target (staging/prod) accounts in order to perform actions.
The following steps were made:
- Created a new S3 bucket commapp-terraform in the Terraform/Infra AWS account
- Set up appropriate permissions to access the bucket
- Both staging and prod accounts have a Terraform IAM role, assumable by the Terraform/Infra account
- Set up the code in this diff.
- Log in to the Terraform/Infra account with CLI and ran terraform init -migrate-state to copy local state to S3.
Depends on D8667