Terraform Backend Generator - Configure State Storage
Generate Terraform backend configurations for AWS S3, Azure Blob, GCS, and more. Configure remote state storage with locking and encryption.
S3 Backend
AWS Setup (one-time)
# Create S3 bucket
aws s3api create-bucket \
--bucket my-terraform-state \
--region us-east-1
# Enable versioning
aws s3api put-bucket-versioning \
--bucket my-terraform-state \
--versioning-configuration Status=Enabled
# Create DynamoDB table for locking
aws dynamodb create-table \
--table-name terraform-locks \
--attribute-definitions AttributeName=LockID,AttributeType=S \
--key-schema AttributeName=LockID,KeyType=HASH \
--billing-mode PAY_PER_REQUESTInitialize
# Initialize with backend
terraform init
# Reconfigure existing backend
terraform init -reconfigure
# Migrate state to new backend
terraform init -migrate-state