-
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): custom originId not used for multiple behaviors with same origin #22830
Conversation
|
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). |
Thanks again @patricksuter looks all good for the automation to take over now. |
@mrgrain thanks for the quick reaction, nice to see the fix coming back! should I close the other PR or do you prefer to close/delete it? |
I've already closed it. 😅 The automation didn't like having two PRs with the same commit hashes. |
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). |
… same origin (#22830) When setting custom `originId`s for CloudFront origins und the new `Distribution` construct there is an issue when using the same origin for multiple behaviours. The first behaviour uses the correct custom `originId` as `TargetOriginId` but every behaviour after that use the auto-generated `originId` instead of the correct custom id. fixes #22758 Improved the handling of the `originId` to correctly pick either the auto-generated `originId` or the explicitly set `originId` of the origin. The issue was caused by the auto-generated `originId` to always be set on the internal list of origins which caused issues when adding more than one behaviour since the wrong id was returned when re-using an existing origin from the internal list. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When setting custom
originId
s for CloudFront origins und the newDistribution
construct there is an issue when using the same origin for multiple behaviours. The first behaviour uses the correct customoriginId
asTargetOriginId
but every behaviour after that use the auto-generatedoriginId
instead of the correct custom id.fixes #22758
Improved the handling of the
originId
to correctly pick either the auto-generatedoriginId
or the explicitly setoriginId
of the origin. The issue was caused by the auto-generatedoriginId
to always be set on the internal list of origins which caused issues when adding more than one behaviour since the wrong id was returned when re-using an existing origin from the internal list.All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license