Skip to content

Instantly share code, notes, and snippets.

@innovia
Created January 28, 2019 09:25
Show Gist options
  • Save innovia/c45b1bb999754910046ffcdba52bcaec to your computer and use it in GitHub Desktop.
Save innovia/c45b1bb999754910046ffcdba52bcaec to your computer and use it in GitHub Desktop.
tf-override
## main.tf
resource "aws_s3_bucket" "s3_bucket" {
count = "${var.enabled}"
bucket = "${local.bucket_name}"
region = "${var.region}"
force_destroy = "${var.force_destroy}"
acl = "private"
versioning = {
enabled = "${var.versioning_enabled}"
}
## website_override.tf
resource "aws_s3_bucket" "s3_bucket" {
count = "${var.website}"
bucket = "${var.full_domain_name}"
region = "us-east-1"
website = {
index_document = "${var.index_document}"
error_document = "${var.404_document}"
}
policy = "${data.aws_iam_policy_document.website.json}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment