33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# =============================================================================
|
|
# S3 Remote Backend Configuration
|
|
# =============================================================================
|
|
#
|
|
# To enable remote state storage:
|
|
# 1. Create S3 bucket and DynamoDB table (see commands below)
|
|
# 2. Copy this file: cp backend.tf.example backend.tf
|
|
# 3. Update bucket/table names below
|
|
# 4. Run: terraform init -migrate-state
|
|
#
|
|
# Prerequisites (run once):
|
|
# aws s3 mb s3://YOUR-BUCKET-NAME --region us-east-1
|
|
# aws dynamodb create-table \
|
|
# --table-name terraform-locks \
|
|
# --attribute-definitions AttributeName=LockID,AttributeType=S \
|
|
# --key-schema AttributeName=LockID,KeyType=HASH \
|
|
# --billing-mode PAY_PER_REQUEST \
|
|
# --region us-east-1
|
|
# =============================================================================
|
|
|
|
terraform {
|
|
backend "s3" {
|
|
bucket = "YOUR-TERRAFORM-STATE-BUCKET" # Change this
|
|
key = "fast/terraform.tfstate"
|
|
region = "us-east-1"
|
|
dynamodb_table = "terraform-locks"
|
|
encrypt = true
|
|
}
|
|
}
|