Grant CI deploy role S3 bucket CORS permissions - #126
Merged
Conversation
The staging deploy failed because the CI role lacks s3:PutBucketCORS, which the new bucket CorsConfiguration requires. Add Get/PutBucketCORS scoped to the three data buckets, note the admin-first-deploy caveat in the docs, and add a sam-status helper to check stack state. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Deploy Lambda functionworkflow failed at theDeploy SAM stackstep with a 403: the CI deploy role (data-hub-deploy-<env>/GitHubActions) is not authorized to performs3:PutBucketCORS, which the buckets'CorsConfigurationrequires. The stack rolled back.s3:GetBucketCORS/s3:PutBucketCORSto theGitHubActionsDeployRoleSamDeploypolicy, scoped to the three data buckets (raw/processed/archives), mirroring the existing notification statement.developer-docs/ci-and-deployment.md, including the caveat that the first deploy granting the permission must be run by an admin (make sam-deploy), since CI can't grant itself a permission and use it in the same changeset.make sam-status ENV=<env>helper to check CloudFormation stack state (useful for spottingUPDATE_IN_PROGRESSbefore retrying a deploy).Test plan
make sam-deploy ENV=stagingonce to land the new permission + CORS config.s3:PutBucketCORS403).make sam-status ENV=stagingreturns the stack status.Made with Cursor