Skip to content

Commit

Permalink
fix website configuration for public bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
djelusic committed Feb 14, 2022
1 parent e6a53c0 commit c6c6b90
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions node/terraform/modules/public-site/main.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
resource "aws_s3_bucket" "public" {
bucket = var.bucket_name
force_destroy = true

website {
index_document = "index.html"
error_document = "index.html"
}
}

resource "aws_s3_bucket_acl" "public_read" {
bucket = aws_s3_bucket.public.id
acl = "public-read"
}

resource "aws_s3_bucket_website_configuration" "public" {
bucket = aws_s3_bucket.public.id
index_document {
suffix = "index.html"
}
error_document {
key = "error.html"
}
}

resource "aws_s3_bucket_policy" "public_read" {
bucket = aws_s3_bucket.public.id
policy = jsonencode({
Expand Down

0 comments on commit c6c6b90

Please sign in to comment.