Skip to content

Conversation

@finnholland
Copy link
Contributor

Description of the proposed changes

Package to handle hosted zones for setting up new projects or managing existing ones. Works with Route53 domains and external providers (with NS records) and provides ways to adjust resources easily.

  • Provides a way to create a hosted zone for a domain or use one that already exists
  • Create CNAME, A, AAAA, MX, and SRV records in said zone
  • Create a certificate if none exists already with the default domain name or additional subdomains if wanted
  • README (and fixed some white space in root README)
    Tried to keep it quite optional with the only requirement being a domain name, I've tested all the different ways to set it up but may have missed one, can add tests if needed

I needed this and thought these constructs might also find a use for it

Notes to reviewers

🛈 When you've finished leaving feedback, please add a final comment to the PR tagging the author, letting them know that you have finished leaving feedback

Create hosted zones, SSL certs and DNS records
@finnholland finnholland requested a review from a team as a code owner January 9, 2026 14:05
@finnholland finnholland force-pushed the feature/domain-hosting-stack branch 5 times, most recently from 7b6a877 to b2719f4 Compare January 9, 2026 22:56
Copy link
Member

@TheOrangePuff TheOrangePuff left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for contributing 🙂 Just some very minor points to address

} = props;

let hostedZone;
const createCert = createCertificate || subDomains.length > 0;
Copy link
Member

Choose a reason for hiding this comment

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

I'm unclear why the subDomain length is relevant here? 🤔 Maybe add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not entirely necessary but just helps in case the user wants to add subdomains to their certificate but forgot to say createCertificate I've also gone and updated it to certificateSubDomains to make it a bit more explicit as that's all their used for.

| { type: "SRV"; name: string; value: SrvRecordValue[] };

export interface DomainHostingProps {
domainName: string;
Copy link
Member

Choose a reason for hiding this comment

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

Can you add some basic JS doc to these variables? We're trying to be more consistent with this 😅

See this as an example: https://github.com/aligent/cdk-constructs/blob/main/packages/static-hosting/lib/static-hosting.ts

});
break;
default:
break;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps default should throw an error to say type not implemented?

Make sure to install compatible versions of these packages in your CDK application.

## Usage
### `domainName`(string)
Copy link
Member

Choose a reason for hiding this comment

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

I'd just move these from the readme into the JS doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants