Skip to content

Commit

Permalink
Merge pull request #3 from hazelops/CORE-331-module-hazelops-route-53…
Browse files Browse the repository at this point in the history
…-healthcheck-aws-is-upgraded-to-conform-to-new-terraform-provider

CORE-331-module-hazelops-route-53-healthcheck-aws-is-upgraded-to-conform-to-new-terraform-provider
  • Loading branch information
kobrikx authored May 31, 2022
2 parents c017e36 + 42ae58b commit 5c1389a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions s3_website.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
resource "aws_s3_bucket" "this" {
count = var.r53_failover_enabled ? 1 : 0
bucket = var.fqdn
acl = "public-read"

tags = {
Terraform = "true"
Expand All @@ -26,17 +25,23 @@ resource "aws_s3_bucket" "this" {
}
EOF

website {
index_document = "index.html"
}
}

resource "aws_s3_bucket_object" "this" {
resource "aws_s3_bucket_acl" "this" {
bucket = aws_s3_bucket.this[0].id
acl = "public-read"
}

resource "aws_s3_bucket_website_configuration" "this" {
count = var.r53_failover_enabled ? 1 : 0
key = "index.html"
bucket = aws_s3_bucket.this[0].id
source = "${path.module}/index.html"
content_type = "text/html"

index_document {
suffix = "index.html"
}
error_document {
key = "index.html"
}
}

resource "aws_route53_record" "this" {
Expand All @@ -55,4 +60,4 @@ resource "aws_route53_record" "this" {
type = "SECONDARY"
}
set_identifier = "${var.fqdn}-SECONDARY"
}
}

0 comments on commit 5c1389a

Please sign in to comment.