fix: allow channel-project S3 bucket refresh - #44
Merged
Conversation
Contributor
OpenTofu TestOpenTofu test passed. View run output |
Contributor
OpenTofu PlanOpenTofu plan passed. View run outputOpenTofu will perform the following actions:
# aws_iam_role_policy.github_actions_channel_project_site_infrastructure will be updated in-place
~ resource "aws_iam_role_policy" "github_actions_channel_project_site_infrastructure" {
id = "github-actions-channel-project-site-infrastructure:channel-project-site-infrastructure"
name = "channel-project-site-infrastructure"
~ policy = jsonencode(
~ {
~ Statement = [
# (3 unchanged elements hidden)
{
Action = [
"s3:CreateBucket",
]
Effect = "Allow"
Resource = "*"
Sid = "CreateSiteBuckets"
},
~ {
~ Action = [
# (10 unchanged elements hidden)
"s3:GetBucketVersioning",
+ "s3:ListBucket",
"s3:PutBucketAcl",
# (7 unchanged elements hidden)
]
# (3 unchanged attributes hidden)
},
{
Action = [
"cloudfront:CreateOriginAccessControl",
"cloudfront:DeleteOriginAccessControl",
"cloudfront:GetOriginAccessControl",
"cloudfront:GetOriginAccessControlConfig",
"cloudfront:ListOriginAccessControls",
"cloudfront:UpdateOriginAccessControl",
]
Effect = "Allow"
Resource = "*"
Sid = "ManageSiteOriginAccessControl"
},
# (2 unchanged elements hidden)
]
# (1 unchanged attribute hidden)
}
)
# (1 unchanged attribute hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
OpenTofu will perform the following actions:
# aws_iam_role_policy.github_actions_channel_project_site_infrastructure will be updated in-place
~ resource "aws_iam_role_policy" "github_actions_channel_project_site_infrastructure" {
id = "github-actions-channel-project-site-infrastructure:channel-project-site-infrastructure"
name = "channel-project-site-infrastructure"
~ policy = jsonencode(
~ {
~ Statement = [
# (3 unchanged elements hidden)
{
Action = [
"s3:CreateBucket",
]
Effect = "Allow"
Resource = "*"
Sid = "CreateSiteBuckets"
},
~ {
~ Action = [
# (10 unchanged elements hidden)
"s3:GetBucketVersioning",
+ "s3:ListBucket",
"s3:PutBucketAcl",
# (7 unchanged elements hidden)
]
# (3 unchanged attributes hidden)
},
{
Action = [
"cloudfront:CreateOriginAccessControl",
"cloudfront:DeleteOriginAccessControl",
"cloudfront:GetOriginAccessControl",
"cloudfront:GetOriginAccessControlConfig",
"cloudfront:ListOriginAccessControls",
"cloudfront:UpdateOriginAccessControl",
]
Effect = "Allow"
Resource = "*"
Sid = "ManageSiteOriginAccessControl"
},
# (2 unchanged elements hidden)
]
# (1 unchanged attribute hidden)
}
)
# (1 unchanged attribute hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. |
This was referenced Sep 4, 2026
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
Add
s3:ListBucketfor the two project-owned static-site buckets to the existinggithub-actions-channel-project-site-infrastructurerole policy.The channel-project OpenTofu plan refreshes both bucket addresses. Although the buckets exist and the role already has their configuration read/write actions, S3
HeadBucketrequiress3:ListBucket; AWS returns a generic failure when that permission is absent. The provider therefore reports both state-tracked buckets as deleted and plans duplicate creates. This PR grants only the missing bucket-level discovery action on the two canonical bucket ARNs.Fixes # N/A — recovery prerequisite for channel-project PR #15.
Type of change
Validation
No local OpenTofu, state, import, plan, or apply operation was run or claimed. The latest channel-project plan passed validation but refreshed the two state-tracked buckets as externally deleted and planned replacement. A read-only AWS inspection in account
332355796717confirmed both buckets exist inus-west-2with public access blocked, bucket-owner enforcement, and AES256 default encryption. AWS documents thatHeadBucketrequiress3:ListBucket.Impact and rollout
Producer:
tfroot-awsis the canonical owner of this OIDC role and inline policy. Consumer:channel-project/tofu/awsuses the role through the reusable OpenTofu workflow.After merge and environment-gated main apply, rerun the channel-project plan. It must refresh the existing buckets successfully and no longer propose their creation before any recovery PR is merged or any main apply is allowed. This change neither creates/deletes buckets nor deploys site assets, CloudFront, ACM aliases, or DNS changes on its own.
Rollback before apply is closing/reverting this PR. If applied, reverting removes only the added discovery permission; it must not be reverted while the channel-project root still needs to refresh those buckets.
Safety and secrets
AI agent materially produced this change; reviewers should verify the two bucket ARNs are the intended project-owned resources and that
s3:ListBucketis sufficient for the AWS provider refresh path.