Skip to content

Instantly share code, notes, and snippets.

@restump
Created November 5, 2017 20:21
Show Gist options
  • Save restump/d11257e33c34d251c1dfe5a3cc783c3a to your computer and use it in GitHub Desktop.
Save restump/d11257e33c34d251c1dfe5a3cc783c3a to your computer and use it in GitHub Desktop.
provider "aws" {
profile = "${var.profile}"
region = "${var.region}"
assume_role {
role_arn = "arn:aws:iam::${var.account_id}:role/${var.assume_role}"
}
}
resource "aws_s3_bucket" "tf_state_storage" {
bucket = "rdc-com-terraform-state"
versioning {
enabled = true
}
lifecycle {
prevent_destroy = true
}
}
resource "aws_dynamodb_table" "tf_state_locking" {
name = "rdc-com-terraform-locks"
read_capacity = 20
write_capacity = 20
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
lifecycle {
prevent_destroy = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment