-
install
tfenv
to manage multiple versions: https://github.com/tfutils/tfenv -
our
init.tf
file has arequired_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
-
make sure you set up an
AWS_PROFILE
in your~/.aws/confg|credentials
files for the correct account/region -
then:
cd /terraform/veda-wfs3
-
then:
AWS_PROFILE=<account> terraform init
-
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
-
before you
plan|apply
changes make sure youcp envtf.template .envtf.sh
and change values in there for secrets needed -
then:
source .envtf.sh
-
finally you can
plan
andapply
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)