Skip to content

Commit 39f696b

Browse files
authored
Merge pull request #3 from msb/access-denied-for-redirect
Addresses "Getting AccessDenied for redirect domain"
2 parents c7a2e85 + 2987872 commit 39f696b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

main.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,17 @@ resource "aws_cloudfront_distribution" "website_cdn_redirect" {
271271

272272
origin {
273273
origin_id = "origin-bucket-${aws_s3_bucket.website_redirect.id}"
274-
domain_name = aws_s3_bucket.website_redirect.bucket_regional_domain_name
275-
276-
s3_origin_config {
277-
origin_access_identity = aws_cloudfront_origin_access_identity.origin_access_identity_website.cloudfront_access_identity_path
274+
domain_name = aws_s3_bucket.website_redirect.website_endpoint
275+
276+
custom_origin_config {
277+
http_port = 80
278+
https_port = 443
279+
origin_keepalive_timeout = 5
280+
origin_protocol_policy = "http-only"
281+
origin_read_timeout = 30
282+
origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
283+
}
278284
}
279-
}
280285

281286
default_root_object = "index.html"
282287

0 commit comments

Comments
 (0)