Skip to content

feat(aws-certificatemanager): add DnsValidatedCertificateV2 - #82

Open
garysassano wants to merge 11 commits into
open-constructs:mainfrom
garysassano:feat/native-dns-certificate
Open

garysassano wants to merge 11 commits into
open-constructs:mainfrom
garysassano:feat/native-dns-certificate

Conversation

@garysassano

@garysassano garysassano commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Reason for this change

DnsValidatedCertificateV2 creates a public DNS-validated ACM certificate with native CloudFormation resources. For cross-region use, certificateRegion creates the owner stack, re-imports the Route 53 zone, and checks the primary name and SANs against zone authority. Core CDK already supports sharing a certificate from an explicitly managed owner stack.

Description of changes

  • Keep the certificate in the containing stack by default, create a regional owner with certificateRegion, or use an explicit certificateStack. Generated owners are named <containing stack>-certificates-<region>.
  • Support one validation zone or an exact hostedZonesByDomain mapping, and expose the standard ICertificate interface.
  • Use weak native cross-stack ARN references, with a guard against sharing a nested owner's certificate outside its top-level stack tree. Weak references to this certificate override the app's default reference strength.
  • Add unit tests, a CloudFront integration test with snapshot, and a module README in the same format as the other constructs.

Description of how you validated changes

  • Exact-head CI passed the build and JavaScript/Python package jobs. Locally, npm run build passed 436 tests, including 196 ACM tests.
  • ACM coverage is 99.07% statements/lines, 98.43% branches, and 100% functions. The uncovered lines are two defensive paths: an unexpected ACM default child and a changed region on a generated owner.
  • The integration test was deployed with a real public hosted zone: ACM issued the certificate in us-east-1, CloudFront deployed from eu-central-1 with the expected viewer certificate, and both assertions passed. All stacks, the certificate, the distribution, and the validation record were removed afterwards.
  • The committed snapshot was then regenerated without deploying, using the placeholder zone Z23ABC4XYZL05B / example.com that aws-cdk uses, so it contains no real account or hosted-zone identifiers. It compares UNCHANGED with those values.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@garysassano garysassano changed the title feat(aws-certificatemanager): add native DNS validated certificate feat(aws-certificatemanager): add DnsValidatedCertificateV2 Sep 6, 2026
@garysassano
garysassano marked this pull request as ready for review September 6, 2026 09:20
@garysassano garysassano changed the title feat(aws-certificatemanager): add DnsValidatedCertificateV2 feat(aws-certificatemanager): add DnsValidatedCertificateV2 Sep 6, 2026
@garysassano
garysassano force-pushed the feat/native-dns-certificate branch from 4b9484e to 3435896 Compare September 6, 2026 09:28
@garysassano
garysassano marked this pull request as draft September 6, 2026 09:56
@garysassano
garysassano marked this pull request as ready for review September 6, 2026 12:23
@garysassano
garysassano force-pushed the feat/native-dns-certificate branch from 4e5adfb to eff05ed Compare September 23, 2026 02:34
@garysassano
garysassano marked this pull request as draft September 23, 2026 02:35
@garysassano
garysassano force-pushed the feat/native-dns-certificate branch from eff05ed to 32556ec Compare September 23, 2026 02:43
@garysassano
garysassano marked this pull request as ready for review September 23, 2026 02:53
@garysassano
garysassano force-pushed the feat/native-dns-certificate branch from 32556ec to 291fe7e Compare September 23, 2026 09:59
Follow the module README layout used by the other constructs, move the
integration runbook into the fixture, and restore the root README and
.npmignore to main.
Deployed against a real public zone, then regenerated with the
placeholder zone Z23ABC4XYZL05B / example.com used by aws-cdk.
Generated owners were named dns-validated-certificate-stack-<hash>-<region>,
which is opaque in the CloudFormation console and becomes permanent once
deployed. Name them <containing stack>-certificates-<region> instead, and
reject a name shared by two different containing stacks.

Also stop doubling the construct path in the certificate factory error.
@garysassano
garysassano force-pushed the feat/native-dns-certificate branch 5 times, most recently from 9681d34 to 24425ec Compare September 23, 2026 12:38
@garysassano
garysassano force-pushed the feat/native-dns-certificate branch from 24425ec to d58e7a9 Compare September 23, 2026 12:45
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.

1 participant