Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.21 KB

IACHOWTO.md

File metadata and controls

40 lines (26 loc) · 1.21 KB

We use Terraform in this repository for IAC:

  1. install tfenv to manage multiple versions: https://github.com/tfutils/tfenv

  2. our init.tf file has a required_version = "1.3.9" so install that:

$ tfenv list
  1.1.5
  1.1.4
  
$ tfenv install 1.3.9
$ tfenv use 1.3.9
  1. make sure you set up an AWS_PROFILE in your ~/.aws/confg|credentials files for the correct account/region

  2. then: cd /terraform/veda-wfs3

  3. then: AWS_PROFILE=<account> terraform init

  4. we also use Terraform "workspaces" so our infra state stays nicely separated in the same S3 bucket. Some quick samples of how to interact with that:

$ AWS_PROFILE=<account> terraform workspace list        
* default
  west2-staging
  
$ AWS_PROFILE=<account> terraform workspace select west2-staging
  default
* west2-staging
  1. before you plan|apply changes make sure you cp envtf.template .envtf.sh and change values in there for secrets needed

  2. then: source .envtf.sh

  3. finally you can plan and apply your changes:

AWS_PROFILE=<account> terraform <plan|apply> -var-file=./vars/<environment>.tf (where <environment>.tf should quite literally match the name of the workspace)