Repository navigation
feat(cognito): accept an explicit hosted zone for custom domains - #99
Merged
Merged
Conversation
CognitoUserPoolConstruct always found the custom-domain hosted zone with HostedZone.FromLookup, a synth-time context lookup that requires AWS credentials (or a cached cdk.context.json value). Consumers that already know the zone could not synthesize offline, for example in credential-free pull request CI. Add an optional CognitoUserPoolDomainProps.HostedZone. When supplied it is used for certificate DNS validation and the alias record, and no lookup is performed; when null the existing lookup is unchanged. The interface member has a default implementation so existing implementers keep compiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CognitoUserPoolConstructresolved a custom domain's hosted zone withHostedZone.FromLookup, a synth-time context lookup that needs AWS credentials or a cachedcdk.context.jsonvalue. Consumers that already know their zone (Sharedale builds it withHostedZone.FromHostedZoneAttributes) could not synthesize without AWS access, which blocks credential-free PR CI (sharedale/sharedale#69: PR jobs synthesize untrusted code with no AWS credentials).ICognitoUserPoolDomainProps.HostedZone/CognitoUserPoolDomainProps.HostedZone(IHostedZone?). When supplied, it is used for certificate DNS validation and the alias record, and no context lookup is performed.null(the default), behavior is unchanged: the lookup still happens. The interface member uses a default implementation (=> null), so existing custom implementations ofICognitoUserPoolDomainPropskeep compiling.docs/constructs/cognito-user-pool.mddocumentsHostedZone(and the previously undocumentedCertificate) and an offline-synthesis example.StaticSiteConstructhas the same unconditionalHostedZone.FromLookup; it is not changed here (Sharedale does not use it). It could get the same option in a follow-up.TDD evidence
Construct_ShouldUseSuppliedHostedZone_WithoutContextLookup_WhenCustomDomainHasHostedZone: asserts the cloud assembly has no missing context and theAWS::Route53::RecordSettargets the supplied zone ID.Expected app.Synth().Manifest.Missing to be null or empty, but found at least one item.props.Domain.HostedZone ?? HostedZone.FromLookup(...).Construct_ShouldLookUpHostedZone_WhenCustomDomainHasNoHostedZone: characterization of the unchanged default (one missinghosted-zone:context entry); passed before and after.Validation
dotnet build LayeredCraft.Cdk.Constructs.slnx: 0 warnings, 0 errors.dotnet test --solution LayeredCraft.Cdk.Constructs.slnx: 676/676 passed (169 × net8.0, net9.0, net10.0, net11.0).dotnet format --verify-no-changeson the changed C# files: clean. Note: the repository-widedotnet format --verify-no-changesalready fails onmain(whitespace inTestKit/Customizations/LambdaFunctionConstructCustomization.csandStaticSiteConstructCustomization.cs); those files are untouched here.🤖 Generated with Claude Code