-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cloudfront-origins): policy not added for custom OAI #18192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good to me @smguggen, but be sure to run the integration tests! 🙂
@peterwoodworth Yeah I just came back and saw that. I've been wracking my brain trying to figure out why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will let @njlynch take a look before merge
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
aws/aws-cdk#18192 lets us use the default OAI config that deploys more restricted permissions (without us doing anything).
aws/aws-cdk#18192 lets us use the default OAI config that deploys more restricted permissions (without us doing anything).
Thank you! ❤️ That allowed some simplifications in our CDK constructs (getlift/lift#150) |
Closes [**aws#18185**](aws#18185): When creating an `S3Origin` without including an existing `Origin Access Identity`, an `OriginAccessIdentity` is created and added to the bucket's resource policy. However, since the adding to the resource policy is inside of the `if (!this.originAccessIdentity)`closure, custom OAI's are not added to the bucket policy by default. Since using `bucket.grantRead` creates an overly permissive policy (as noted in the source code comments), adding the OAI to the bucket policy by default for both cases would create a more consistent result. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Closes #18185: When creating an
S3Origin
without including an existingOrigin Access Identity
, anOriginAccessIdentity
is created and added to the bucket's resource policy. However, since the adding to the resource policy is inside of theif (!this.originAccessIdentity)
closure, custom OAI's are not added to the bucket policy by default. Since usingbucket.grantRead
creates an overly permissive policy (as noted in the source code comments), adding the OAI to the bucket policy by default for both cases would create a more consistent result.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license