In general, you should use GitHub Actions to actually deploy, instead of deploying locally. The local instructions are provided primarily to aid in testing plans during dev and for troubleshooting.
The tf
folder is divided into envs
and modules
(none yet).
Each environment has a folder in envs
. For example, the dev
folder houses
code for the dev
environment.
First set up an AWS SSO profile for the FAN Apps
account using:
aws configure sso --profile fan-apps-admin
Then, once per session, you'll run the following to login and cache credentials:
aws sso login --profile fan-apps-admin
The first time you work in an environment, you'll need to init
:
cd tf/envs/dev # or whatever env
terraform init
To run terraform commands such as plan
and apply
, set the AWS profile:
AWS_PROFILE=fan-apps-admin terraform plan
The terraform configuration makes use of the following environment variables:
TF_API_TOKEN
- Team wide API token used to authenticate against Terraform Cloud when applying a new Terraform config
<ENV>_AWS_PLAN_ROLE
- ARN for the AWS github-actions-infra
role