Terraform state for small teams
1 min read
On this page
Terraform state maps your configuration to real resources. Losing it, or editing it concurrently, is how small teams end up with orphaned infrastructure.
Store state remotely
terraform {
backend "s3" {
bucket = "my-team-tfstate"
key = "prod/terraform.tfstate"
region = "ap-southeast-1"
use_lockfile = true
}
}Lock every run
Locking prevents two terraform apply runs from writing state at the same time.
Related posts
AWS IAM policies: follow the request, find the Deny
Animated AWS IAM walkthroughs explain policy types, permissions boundaries, KMS, cross-account access and why one matching Deny overrides every Allow.
AWS acceleration: pick the right service for the slow leg
Six AWS acceleration services — CloudFront, Global Accelerator, S3TA, VPN, DAX, ENA/EFA — chosen by the slow leg, caching and protocol.
Speeding up EC2 and Lambda boot time
How to shorten Lambda cold starts and EC2 scale-out time with SnapStart, Provisioned Concurrency and warm pools, plus where each one stops working.
