-
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
(cloudfront): (custom originId handling issue for multiple behaviours with same origin) #22758
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p2
Comments
4 tasks
Thanks for reporting and submitting a fix @patricksuter, we'll try to take a look at your PR soon |
4 tasks
mergify bot
pushed a commit
that referenced
this issue
Nov 8, 2022
… 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*
|
iliapolo
pushed a commit
that referenced
this issue
Nov 9, 2022
… 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*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p2
Describe the bug
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 customoriginId
.Expected Behavior
The custom
originId
is used for every usage of the origin in the behaviors in theTargetOriginId
property.Current Behavior
Only the first behaviour using a given origin uses the correct custom
originId
in theTargetOriginId
property. Every behaviour after that uses the auto-generated id.Reproduction Steps
Create origin with custom
originId
and use it in at least two behaviours.Possible Solution
Prepared the following fix: #22756
Additional Information/Context
No response
CDK CLI Version
2.50.0
Framework Version
No response
Node.js Version
v14.19.1
OS
OSX
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: