File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Terraform Backend Configuration
2+ # Uncomment the block below and configure with your S3 bucket and DynamoDB table
3+ # to enable remote state management.
4+ #
5+ # Prerequisites:
6+ # 1. Create an S3 bucket for state storage (enable versioning)
7+ # 2. Create a DynamoDB table for state locking (partition key: LockID)
8+ #
19# terraform {
210# backend "s3" {
3- # bucket = "ahsan-tf"
4- # key = "terraform.tfstate"
5- # region = "us-west-2"
6- # dynamodb_table= "ahsan-tf"
7- # }
8- # }
9-
10- # resource "aws_s3_bucket" "bucket" {
11- # bucket = "ahsan-tf"
12- # region = "us-west-2"
13- # lifecycle {
14- # prevent_destroy = true
11+ # bucket = "your-terraform-state-bucket"
12+ # key = "Terraform-2Tier-RDS/terraform.tfstate"
13+ # region = "us-east-1"
14+ # encrypt = true
15+ # dynamodb_table = "terraform-state-lock"
1516# }
1617# }
17-
18- # resource "aws_dynamodb_table" "terraform_state_lock" {
19- # name = "terraform-lock"
20- # read_capacity = 5
21- # write_capacity = 5
22- # hash_key = "LockID"
23- # lifecycle {
24- # prevent_destroy = true
25- # }
26- # attribute {
27- # name = "LockID"
28- # type = "S"
29- # }
30- # }
You can’t perform that action at this time.
0 commit comments