Created
November 7, 2017 17:51
-
-
Save eefahy/42136d53231ce3572c11e7ab6bafd634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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