1.3 KiB
1.3 KiB
My Personal Terraform Template
Featuring
- Terraform without hardcoding
- S3 Backend for Terraform State + DynamoDB Locking Table with partial configuration
- Hashicorp Vault with my personal deployment
- Aws-Vault
- Multiple examples
How to use
- Template it
- Provide S3 Backend Configuration in backend.hcl and input key in providers.tf
- Provide Vault Configuration in vault.hcl and input key for state file isolation in providers.tf
- 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