2019-05-28 16:33:58 +00:00
|
|
|
/* DERIVED --------------------------------------*/
|
|
|
|
|
|
|
|
provider "aws" {
|
|
|
|
region = "us-east-1"
|
|
|
|
access_key = "${var.aws_access_key}"
|
|
|
|
secret_key = "${var.aws_secret_key}"
|
|
|
|
}
|
|
|
|
|
2019-05-28 18:51:33 +00:00
|
|
|
provider "gandi" {
|
|
|
|
key = "${var.gandi_api_token}"
|
|
|
|
}
|
|
|
|
|
2019-05-28 16:33:58 +00:00
|
|
|
/* DATA -----------------------------------------*/
|
|
|
|
|
2019-05-28 16:50:35 +00:00
|
|
|
terraform {
|
|
|
|
backend "s3" {
|
|
|
|
bucket = "dapps-terraform-state"
|
|
|
|
key = "infra-dapps"
|
|
|
|
region = "us-east-1"
|
|
|
|
encrypt = true
|
|
|
|
}
|
|
|
|
}
|
2019-05-28 16:33:58 +00:00
|
|
|
|
|
|
|
/* INVENTORY ------------------------------------*/
|
|
|
|
|
|
|
|
resource "aws_s3_bucket" "tf-state" {
|
|
|
|
bucket = "dapps-terraform-state"
|
|
|
|
acl = "private"
|
|
|
|
|
|
|
|
tags = {
|
|
|
|
Name = "Terraform State Store"
|
|
|
|
}
|
|
|
|
|
2019-05-31 15:36:28 +00:00
|
|
|
policy = "${file("files/s3-policy.json")}"
|
2019-05-28 16:33:58 +00:00
|
|
|
|
|
|
|
versioning {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
|
|
|
|
lifecycle {
|
|
|
|
prevent_destroy = true
|
|
|
|
}
|
|
|
|
}
|