fix(cloudfront): propagate originAccessControlId CloudFront Origin property to CloudFormation templates#32020
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
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
gracelu0
left a comment
There was a problem hiding this comment.
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.
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.tshere which returns a test origin withoriginAccessControlIddefined - adding a unit test to
distribution.test.tswhich sets up a distribution using the test origin from above and check that theOriginproperty inDistributionConfigcontainsOriginAccessControlId(can reference existing unit test here)
Let me know if you need more guidance on this.
There was a problem hiding this comment.
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
aws-cdk-automation
left a comment
There was a problem hiding this comment.
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.
e6d0d12 to
2ab6331
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32020 +/- ##
=======================================
Coverage 78.19% 78.19%
=======================================
Files 105 105
Lines 7176 7176
Branches 1318 1318
=======================================
Hits 5611 5611
Misses 1377 1377
Partials 188 188
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…Formation templates fixes aws#32018
2ab6331 to
0603410
Compare
gracelu0
left a comment
There was a problem hiding this comment.
Thank you for contributing!
|
@Mergifyio update |
❌ Mergify doesn't have permission to updateDetailsFor security reasons, Mergify can't update this pull request. Try updating locally. |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
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