Skip to content

feat(cloudfront): add Distribution.addOrigin() to register origins without behaviors (#37652)#37657

Open
melchii wants to merge 5 commits intoaws:mainfrom
melchii:aws-cloudfront-add-origin
Open

feat(cloudfront): add Distribution.addOrigin() to register origins without behaviors (#37652)#37657
melchii wants to merge 5 commits intoaws:mainfrom
melchii:aws-cloudfront-add-origin

Conversation

@melchii
Copy link
Copy Markdown
Contributor

@melchii melchii commented Apr 21, 2026

Adds a public addOrigin() method to Distribution that allows adding an origin to the distribution without associating it with a cache behavior. This is useful for pre-registering origins for use in origin groups or other advanced configurations.

closes #37652

Issue # (if applicable)

Closes #37652.

Reason for this change

Adding the ability to add an origin without a behavior to support dynamic routing withing cloudfront functions.

Description of changes

Added .addOrigin() which delegates to the existing internal method. It may be better to just expose the internal, but I added a new function - happy to switch to the other approach based on feedback!

Describe any new or updated permissions being added

None.

Description of how you validated changes

Added unit tests and an integration test.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…thout behaviors (aws#37652)

Adds a public addOrigin() method to Distribution that allows adding an
origin to the distribution without associating it with a cache behavior.
This is useful for pre-registering origins for use in origin groups or
other advanced configurations.

closes aws#37652
@github-actions github-actions Bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Apr 21, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 21, 2026 19:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.
To suppress a specific rule, see Suppressing Rules.


TestsPassed ✅SkippedFailed
Security Guardian Results48 ran48 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.
To suppress a specific rule, see Suppressing Rules.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates48 ran48 passed
TestResult
No test annotations available

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 23, 2026
Copy link
Copy Markdown
Contributor

@laurelmay laurelmay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution and the tests! This looks ready for core team review.

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-cloudfront): add origin without adding a behavior

3 participants