aws / aws/aws-cdk

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

Open
#37,652 2 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/aws-cloudfront effort/medium feature-request p2
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.