Skip to content

Instantly share code, notes, and snippets.

@eefahy
Created November 7, 2017 17:51
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 eefahy/42136d53231ce3572c11e7ab6bafd634 to your computer and use it in GitHub Desktop.
Save eefahy/42136d53231ce3572c11e7ab6bafd634 to your computer and use it in GitHub Desktop.
variable "profile" {}
variable "dynamodb_table_name" {}
variable "s3_bucket_name" {}
provider "aws" {
region = "us-east-1"
profile = "${var.profile}"
version = "~> 0.1"
}
resource "aws_dynamodb_table" "terraform_statelock" {
name = "${var.dynamodb_table_name}"
read_capacity = 20
write_capacity = 20
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
tags {
name = "dynamodb table for locking terraform state"
terraform = "true"
}
}
resource "aws_s3_bucket" "terraform_state" {
bucket = "${var.s3_bucket_name}"
versioning {
enabled = true
}
tags {
name = "terraform state bucket"
terraform = "true"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment