(aws-cloudfront): add origin without adding a behavior
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
When creating a CloudFront distribution via CloudFormation, you can create origins that don't have behaviors. This isn't possible with the L2 construct (no such method is exposed).
### Use Case
The use case is having origins that don't have a behavior, but the CloudFront Function can route to them dynamically.
### Proposed Solution
Expose the `.addOrigin()` function within the CloudFront Distribution construct.
### Other Information
_No response_
### Acknowledgements
- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
latest
### AWS CDK CLI version
2.1108.0 (build eace286)
### Environment details (OS name and version, etc.)
Mac OS 26.4
Contributor guide
Research direction
Start at the CloudFront Distribution L2 construct and trace its existing origin and behavior APIs. Verify how origins are currently added, then expose addOrigin so an origin can exist without a behavior, and confirm the result with the relevant CloudFront construct tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100