Skip to content

Commit fbf2307

Browse files
committed
feat: add S3 backend configuration for remote state management
1 parent bec7fed commit fbf2307

1 file changed

Lines changed: 13 additions & 26 deletions

File tree

backend.tf

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
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-
# }

0 commit comments

Comments
 (0)