aws / aws/aws-cdk

RFC: Custom Global Domain Name Patterns

Open
#35,936 1 comment 0 reactions 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

It'd be great to have a way to set a domain name pattern at the app or stack level that can be defaulted to in constructs.

### Use Case

I find that many times there's copy and pasted logic not only in repos, but spread across repos to handle structuring domains names for endpoints. It seems like teams usually follow common patterns such as `..`, etc.

Some of the copy and pasted code includes:

- Constants file for hosted zones
- Logic for building a domain (see example above), even within one CDK app, such as for CloudFront + API Gateway
- Different teams might also have different domain patterns depending on their architecture. So it makes it challenging to embed opinionated logic about the domain structure in an internal CDK library.

### Proposed Solution

It seems like this could be solved a number of ways including:

- A `domainNamePattern` context key or SSM parameter
- A tag on a hosted zone that marks it as default for the account
- Property injection or aspects that override the domain name for individual resources

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.222.1

### AWS CDK CLI version

2.1031.1

### Environment details (OS name and version, etc.)

Mac OS

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by examining how AWS CDK app and stack context reaches constructs, then compare the proposed context, SSM, hosted-zone tag, and aspect approaches; done requires an agreed design for domain-pattern defaults and its implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.