Skip to content

Commit bb560f7

Browse files
authoredFeb 4, 2022
Merge pull request #22614 from hashicorp/f-s3-bucket-deprecate-website
r/s3_bucket: read-only `website`, `website_endpoint`, and `website_domain` arguments
2 parents 58cedda + 4a7f8e5 commit bb560f7

12 files changed

+319
-632
lines changed
 

‎.changelog/22614.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:breaking-change
2+
resource/aws_s3_bucket: The `website`, `website_domain`, and `website_endpoint` arguments have been deprecated and are now read-only. Use the `aws_s3_bucket_website_configuration` resource instead.

‎internal/service/cloudformation/stack_test.go

+16-8
Original file line numberDiff line numberDiff line change
@@ -851,11 +851,15 @@ resource "aws_s3_bucket" "b" {
851851
]
852852
}
853853
POLICY
854+
}
854855
855-
856-
website {
857-
index_document = "index.html"
858-
error_document = "error.html"
856+
resource "aws_s3_website_configuration" "test" {
857+
bucket = aws_s3_bucket.b.id
858+
index_document {
859+
suffix = "index.html"
860+
}
861+
error_document {
862+
key = "error.html"
859863
}
860864
}
861865
@@ -905,11 +909,15 @@ resource "aws_s3_bucket" "b" {
905909
]
906910
}
907911
POLICY
912+
}
908913
909-
910-
website {
911-
index_document = "index.html"
912-
error_document = "error.html"
914+
resource "aws_s3_bucket_website_configuration" "test" {
915+
bucket = aws_s3_bucket.b.id
916+
index_document {
917+
suffix = "index.html"
918+
}
919+
error_document {
920+
key = "error.html"
913921
}
914922
}
915923

‎internal/service/route53/record_test.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -1767,9 +1767,12 @@ resource "aws_route53_zone" "main" {
17671767
resource "aws_s3_bucket" "website" {
17681768
bucket = %[1]q
17691769
acl = "public-read"
1770+
}
17701771
1771-
website {
1772-
index_document = "index.html"
1772+
resource "aws_s3_bucket_website_configuration" "test" {
1773+
bucket = aws_s3_bucket.website.id
1774+
index_document {
1775+
suffix = "index.html"
17731776
}
17741777
}
17751778
@@ -1780,7 +1783,7 @@ resource "aws_route53_record" "alias" {
17801783
17811784
alias {
17821785
zone_id = aws_s3_bucket.website.hosted_zone_id
1783-
name = aws_s3_bucket.website.website_domain
1786+
name = aws_s3_bucket_website_configuration.test.website_domain
17841787
evaluate_target_health = true
17851788
}
17861789
}

0 commit comments

Comments
 (0)