Move Terraform state into S3 (using DynamoDB for locking).

This commit is contained in:
2020-02-09 01:42:51 -06:00
parent ead77534ce
commit 716f09681c
5 changed files with 30 additions and 836 deletions

View File

@@ -1,8 +1,28 @@
provider "aws" {
region = var.aws_region
}
resource "aws_s3_bucket" "personal_measure" {
bucket = "${var.deploy_bucket_name}"
bucket = "${var.app_root_url}"
acl = "log-delivery-write"
}
resource "aws_dynamodb_table" "dynamodb_terraform-state-lock" {
name = "terraform-state-lock.${var.app_root_url}"
hash_key = "LockID"
read_capacity = 20
write_capacity = 20
attribute {
name = "LockID"
type = "S"
}
tags = {
Name = "Terraform DynamoDB State Lock Table"
}
}
module "dev_env" {
source = "./deployed_env"