fix(aws): order web public access before policy - #50
Merged
Conversation
Contributor
OpenTofu TestOpenTofu test passed. View run output |
Contributor
OpenTofu PlanOpenTofu plan passed. View run outputOpenTofu will perform the following actions:
# aws_s3_bucket_policy.web["orthodox.channel"] will be created
+ resource "aws_s3_bucket_policy" "web" {
+ bucket = "orthodox.channel"
+ id = (known after apply)
+ policy = jsonencode(
{
+ Statement = [
+ {
+ Action = [
+ "s3:GetObject",
]
+ Effect = "Allow"
+ Principal = "*"
+ Resource = "arn:aws:s3:::orthodox.channel/*"
},
]
+ Version = "2012-10-17"
}
)
+ region = "us-west-2"
}
Plan: 1 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:
# aws_s3_bucket_policy.web["orthodox.channel"] will be created
+ resource "aws_s3_bucket_policy" "web" {
+ bucket = "orthodox.channel"
+ id = (known after apply)
+ policy = jsonencode(
{
+ Statement = [
+ {
+ Action = [
+ "s3:GetObject",
]
+ Effect = "Allow"
+ Principal = "*"
+ Resource = "arn:aws:s3:::orthodox.channel/*"
},
]
+ Version = "2012-10-17"
}
)
+ region = "us-west-2"
}
Plan: 1 to add, 0 to change, 0 to destroy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the hidden S3 ordering dependency explicit: every public web-bucket policy waits for the web bucket public-access-block configuration that permits public policies.
No linked issue.
Type of change
Validation
Impact and rollout
aws_s3_bucket_policy.webresource. Consumers: all current and future members oflocal.s3_web_buckets.orthodox.channel, its website configuration, its public-access-block configuration, and the narrowly scoped channel-project deployment policy;PutBucketPolicyraced the access-block configuration and failed before creating the anonymous-read policy.orthodox.channelresources. It does not dispatch a site deployment, modify Cloudflare, alter the private CloudFront rollback path, or move public traffic.Safety and secrets
AI assistance materially produced this change; reviewers should verify that the dependency is limited to
aws_s3_bucket_policy.weband that the plan adds only the missingorthodox.channelpublic-read policy.