Skip to content

Commit

Permalink
CCL-508 added ListBucket action bucket policy (#168)
Browse files Browse the repository at this point in the history
* CCL-497 added 404 custom_error_response

* CCL-508 added ListBucket action bucket policy

* CCL-508 added ListBucket action bucket policy

* CCL-508 fixed conflicts

* CCL-508 fixed conflicts
  • Loading branch information
mynampatinaveen authored Sep 4, 2024
1 parent 916f178 commit 54b2e4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions modules/products/static-site/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ resource "aws_cloudfront_distribution" "static_site_distribution" {

function_association {
event_type = "viewer-request"
function_arn = aws_cloudfront_function.rewritedefaultindexrequest.arn
function_arn = aws_cloudfront_function.rewritedefaultindexrequest.arn
}

}

custom_error_response {
error_code = 404
response_page_path = "/404.html" # Path to your custom error page
response_code = 404
error_code = 404
response_page_path = "/404.html" # Path to your custom error page
response_code = 404
error_caching_min_ttl = 10 # Cache TTL in seconds
}

}


restrictions {
geo_restriction {
restriction_type = "none"
Expand Down
3 changes: 2 additions & 1 deletion modules/products/static-site/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ data "aws_iam_policy_document" "static_site_iam_storage_policy_document" {
identifiers = ["cloudfront.amazonaws.com"]
}
actions = [
"s3:GetObject"
"s3:GetObject",
"s3:ListBucket"
]
resources = [
"arn:aws:s3:::${aws_s3_bucket.static_site.id}/*"
Expand Down

0 comments on commit 54b2e4b

Please sign in to comment.