fix(cloudfront): add region to autogenerated name for cloudfront origin request policy
Issue # (if applicable)
Closes #34336
Reason for this change
So that a stack defining an origin request policy can be easily deployed into more than one region in a single account.
Description of changes
Followed the same naming convention already in place for cache policies, which was added in #13737
Describe any new or updated permissions being added
Description of how you validated changes
Adjusted an existing unit test to recognize the new name
Checklist
- [x] My code adheres to the CONTRIBUTING GUIDE and DESIGN GUIDELINES
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
Exemption Request:
Fixes must contain a change to an integration test file and the resulting snapshot.
The existing integration test for cache policy & origin request policy explicitly set the resource name properties
https://github.com/aws/aws-cdk/blob/7330f91b1aa8360db29384c823948596d1370ca7/packages/%40aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-policies.ts#L33
Not sure if you'd want to see the autogenerated name behavior in the integration suite or not?
Exemption Request:
Fixes must contain a change to an integration test file and the resulting snapshot.
The existing integration test for cache policy & origin request policy explicitly set the resource name properties
https://github.com/aws/aws-cdk/blob/7330f91b1aa8360db29384c823948596d1370ca7/packages/%40aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-policies.ts#L33
Not sure if you'd want to see the autogenerated name behavior in the integration suite or not?
Thanks for identifying the missing integ test gap, i think we should add new one for this use-case.
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing
To prevent automatic closure:
- Resume work on the PR
- OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request:
" - OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request:
"
This PR will automatically close in 14 days if no action is taken.
Clarification Request: @shikha372 this would be my first contribution to the repo, I'm having trouble with the integration test suite. According to the INTEGRATION_TESTS.md file, I should
- Add a new
.tstest file. I addedpackages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-policies-autonamed.tsas a copy of the existing test for cloudfront policies. See https://github.com/aws/aws-cdk/pull/34348/commits/d622e71883aaffb49c6f701a228586f4489fa292. - Run
yarn integ --update-on-failed integ.distribution-policies-autonamed.js, with.jsinstead of.ts
This doesn't seem to find the test:
yarn integ --update-on-failed integ.distribution-policies-autonamed.js
yarn run v1.22.22
$ integ-runner --language javascript --update-on-failed integ.distribution-policies-autonamed.js
No such integ test: integ.distribution-policies-autonamed.js
Available tests: aws-ec2/test/integ.placement-group.js aws-events-targets/test/batch/integ.job-definition-events.js aws-s3-deployment/test/integ.bucket-deployment-signcontent.js aws-stepfunctions-tasks/test/batch/integ.run-batch-job.js aws-stepfunctions-tasks/test/batch/integ.submit-job.js pipelines/test/integ.newpipeline-with-file-system-locations.js
This is running from packages/@aws-cdk-testing/framework-integ as the working directory. I also tried passing the test name as an absolute path, with the same result.
Beyond that operational concern, since what I'd be trying to test here is autogeneration of resource names, snapshot tests won't be able to expect the output to have a stable, consistent name, right? Is there something I'll have to do to allow for randomness in parts of the autogenerated resource names?
AWS CodeBuild CI Report
- CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
- Commit ID: 38aab9095cba5f1762c9d41141d2075b7b2cdc64
- Result: FAILED
- Build Logs (available for 30 days)
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository