Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Created March 29, 2020 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soerenmartius/9baf1aad3b26fdf9fdd78900d244973f to your computer and use it in GitHub Desktop.
Save soerenmartius/9baf1aad3b26fdf9fdd78900d244973f to your computer and use it in GitHub Desktop.
Terraform with S3 Remote State and DynamoDB State Locks
# ---------------------------------------------------------------------------------------------------------------------
# SET TERRAFORM AND PROVIDER REQUIREMENTS
# ---------------------------------------------------------------------------------------------------------------------
terraform {
required_version = "~> 0.12.24"
backend "s3" {
bucket = "github-terraform-example-terraform-state"
key = "organization/github-terraform-example/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-state-lock"
}
required_providers {
github = "~> 2.4"
}
}
provider "github" {
organization = "github-terraform-example"
}
provider "aws" {
region = "us-east-1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment