aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.55k stars 3.87k forks source link

aws_cloudfront_origins: OriginGroup support custom originId #31468

Closed vobarian closed 4 days ago

vobarian commented 1 week ago

Describe the feature

OriginGroup does not appear to support setting an explicit originId currently. The auto-generated ID is very long and hard to read. We would like to set the originId as with other origin types such as HttpOrigin or RestApiOrigin.

Use Case

Create easy to read origin IDs for Origin Groups so we can more easily understand the configuration when looking at it in the CloudFront console.

Proposed Solution

Add originId to OriginGroupProps.

I might be able to implement this; I'm not very familiar with CDK internals but it seems that wherever the auto-generated ID is created, it could instead use the explicit prop if set. I could use a little hint on where this happens.

Other Information

No response

Acknowledgements

CDK version used

2.158.0

Environment details (OS name and version, etc.)

macOS

khushail commented 1 week ago

Hi @vobarian , thanks for reaching out.

Yes, it would be good to provide custom origin id in the origingroup.

This is cdk Code which implements OriginGroup https://github.com/aws/aws-cdk/blob/4b8714d7b499362f0b77ad9a615479227e339078/packages/aws-cdk-lib/aws-cloudfront-origins/lib/origin-group.ts#L31

and this is OriginGroupProps code reference - https://github.com/aws/aws-cdk/blob/4b8714d7b499362f0b77ad9a615479227e339078/packages/aws-cdk-lib/aws-cloudfront-origins/lib/origin-group.ts#L5

Let me know if you need any more information. Thanks for volunteering for contribution!

github-actions[bot] commented 1 week ago

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.