Terraform without hardcoding, S3 Backend
Go to file Use this template
Matthieu Morin 9e7ad34dba Backend partial config public ignore 2024-03-02 13:34:13 +00:00
modules/ex init template with docs 2024-03-02 14:21:38 +01:00
temp init template with docs 2024-03-02 14:21:38 +01:00
.gitignore Backend partial config public ignore 2024-03-02 13:34:13 +00:00
LICENSE Initial commit 2024-03-02 12:26:12 +00:00
README.md init template with docs 2024-03-02 14:21:38 +01:00
backend.hcl init template with docs 2024-03-02 14:21:38 +01:00
outputs.tf init template with docs 2024-03-02 14:21:38 +01:00
providers.tf init template with docs 2024-03-02 14:21:38 +01:00
terraform.tfvars.example init template with docs 2024-03-02 14:21:38 +01:00
variables.tf init template with docs 2024-03-02 14:21:38 +01:00

README.md

My Personal Terraform Template

Featuring

How to use

  1. Template it
  2. Provide S3 Backend Configuration in backend.hcl and input key in providers.tf
  3. Provide Vault Configuration in vault.hcl and input key for state file isolation in providers.tf
  4. Configure AWS with:
AWS configure sso
# fill in ~profile
aws-vault exec ~profile #duration in providers.tf - 1h or less recommended
terraform init -backend-config=backend.hcl && terraform plan
terraform apply

Isolation of state

To isolate within the same configuration, use workspaces. To isolate between configurations, use file layout.

Workspaces

to list workspaces:

terraform workspace list
# default at start

to create a workspace:

terraform workspace new ~workspace

to select a workspace:

terraform workspace select ~workspace

TODO

  • Azure support
  • GCP support