-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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): propagate originAccessControlId
CloudFront Origin property to CloudFormation templates
#32020
base: main
Are you sure you want to change the base?
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 pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
originAccessControlId
CloudFront Origin property to CloudFormation templatesoriginAccessControlId
CloudFront Origin property to CloudFormation templates
Exemption Request I've just fixed the place where the value which supposed to be rendered in the CloudFormation template was missing. It was set in the L2 construct but not propagated to the CloudFormation template. I don't really see how can I write test for this. Can you please guide me with this? |
198bbb8
to
e357ad3
Compare
e357ad3
to
edaa470
Compare
originAccessControlId
CloudFront Origin property to CloudFormation templatesoriginAccessControlId
CloudFront Origin property to CloudFormation templates
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
7878d5a
to
46c5e96
Compare
46c5e96
to
2bc6e3f
Compare
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.
Thanks for opening a PR! I left a comment on updating the tests. I don't think we need an integration test here so once unit tests are updated I can add the exemption label.
defaultBehavior: { origin: new origins.FunctionUrlOrigin(fnUrl) }, | ||
defaultBehavior: { | ||
origin: new origins.FunctionUrlOrigin(fnUrl, { | ||
originAccessControlId: oac.attrId, |
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.
I think we can add a new unit test instead of updating this integration test. For the unit test I'd suggest:
- adding a new function to
test-origin.ts
here which returns a test origin withoriginAccessControlId
defined - adding a unit test to
distribution.test.ts
which sets up a distribution using the test origin from above and check that theOrigin
property inDistributionConfig
containsOriginAccessControlId
(can reference existing unit test here)
Let me know if you need more guidance on this.
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.
Hi @gracelu0, thanks for the feedback!
I have removed the integration tests (which your automated CI forced me to write) and I hope I've added the unit tests correctly. It has run for me so let's see what CI will tell us :-)
Thanks for help!
2bc6e3f
to
8989e83
Compare
Pull request has been modified.
8989e83
to
91da02b
Compare
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 pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
@ivanbarlog I think the build failed due to some lint errors, try running |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
…Formation templates fixes aws#32018
e6d0d12
to
2ab6331
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32020 +/- ##
=======================================
Coverage 77.17% 77.17%
=======================================
Files 105 105
Lines 7169 7169
Branches 1315 1315
=======================================
Hits 5533 5533
Misses 1455 1455
Partials 181 181
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Issue
Closes #32018.
Reason for this change
The originAccessControlId property of CloudFront Origin has not been propagated to CloudFormation templates.
Description of changes
Propagate the property to render function.
Description of how you validated changes
have run the run build over the whole repo - my computer almost exploded.
I have also run tests for the aws-cloudfront which run successfully.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license