Skip to content

Instantly share code, notes, and snippets.

@ksummersill2
Created June 23, 2020 03:40
Show Gist options
  • Save ksummersill2/38387e418c5c3642b8ffe24f146470e8 to your computer and use it in GitHub Desktop.
Save ksummersill2/38387e418c5c3642b8ffe24f146470e8 to your computer and use it in GitHub Desktop.
Setups the S3 Backend Terraform State Management
# State Module
module "state" {
source = ".//modules/state"
}
# Configure Terraform to push production state to an S3 bucket.
terraform {
backend "s3" {
bucket = "<name of your bucket>"
key = "terraform.state"
dynamodb_table = "terraform-lock"
region = "us-east-1"
profile = "<your awscli profile for creds>"
# Make sure to update your shared_credentials_file to your location
shared_credentials_file = "~/.aws/credentials"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment