The repo uses pre-commit
(https://pre-commit.com/) to install and manage git
pre-commit hooks.
brew install pre-commit
brew install terraform-docs
pre-commit install
We manage state per-module. This allows us to work with some isolation to avoid
conflicts with other people's changes and reduces the number of objects synced
during terraform apply
.
cd terraform
./create_state.sh "descriptive_name_for_what_this_module_does"
Then follow the directions given.
## AWS
export AWS_ACCESS_KEY_ID=foo
export AWS_SECRET_ACCESS_KEY=bar
## GCP
export GOOGLE_CLOUD_KEYFILE_JSON=~/.config/gcloud/application_default_credentials.json
## Azure
$ az login
$ az account set --subscription "108d46d5-fe9b-4850-9a7d-8c914aa6c1f0" ## based on subscription
Providers should be regularly upgraded. If you get an error during a plan or apply, always try this first.
terraform init -upgrade