Conversation
…stomResource changes `@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource` renders as "Backwards incompatible bugfix" -- a label generated from its `FlagType`, not written prose -- above three lines that say a custom resource is or is not created. Nothing explains what the swap actually does to the template, so the label is the most alarming thing on the page and there is nothing to weigh it against. Describe both paths and what changes between them: - Disabled, `UserPoolDomain.cloudFrontDomainName` adds an `AwsCustomResource` calling `DescribeUserPoolDomain` and reads `DomainDescription.CloudFrontDistribution` from the response. - Enabled, `UserPoolDomain.cloudFrontEndpoint` reads the `CloudFrontDistribution` attribute of `AWS::Cognito::UserPoolDomain`. Both read the same `CloudFrontDistribution` value, so the alias record resolves to the same CloudFront domain name either way. That is the point the flag documentation was missing, and it matches what the reporter observed when migrating. Also record two things the issue thread never surfaced. Removing the custom resource also removes an IAM statement granting `cognito-idp:DescribeUserPoolDomain` on `*` -- the action does not support resource-level permissions -- so enabling the flag drops a wildcard permission. And the shared `AwsCustomResource` provider Lambda only disappears if nothing else in the stack uses `AwsCustomResource`, since it is a per-stack singleton; saying the Lambda goes away unconditionally would be wrong for most stacks. Add `compatibilityWithOldBehaviorMd`, which this flag was missing. The `FlagType` is deliberately left as `BugFix`: enabling does change the synthesized template, so the classification is correct. What was missing was the detail needed to judge it. closes aws#34317 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
dfernaro
requested a deployment
to
test-pipeline
September 21, 2026 15:00 — with
GitHub Actions
Waiting
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.
Issue # (if applicable)
Closes #34317.
Reason for this change
@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResourcerenders as:followed by three lines saying that a custom resource is, or is not, created. That heading is generated from the flag's
FlagType, not written prose, so the most alarming thing on the page is also the only thing that stands out — and nothing explains what the swap actually does to the template, or what migrating involves.@blimmer reported flipping it on several projects with no downtime and asked why it reads as a breaking change. The thread discussed it but no documentation change was made.
Description of changes
Rewrites the flag's
detailsMdto describe both paths and what actually differs:UserPoolDomain.cloudFrontDomainName(deprecated)UserPoolDomain.cloudFrontEndpointAwsCustomResourcecallingDescribeUserPoolDomaingetAtt('CloudFrontDistribution')onAWS::Cognito::UserPoolDomainDomainDescription.CloudFrontDistributionCloudFrontDistributionBoth read the same
CloudFrontDistributionvalue, so the alias record resolves to the same CloudFront domain name either way. Enabling the flag changes how the template obtains it, not what the record points at. That is the point the documentation was missing, and it matches what @blimmer observed.Two further things, neither of which came up in the issue thread:
cognito-idp:DescribeUserPoolDomain. That statement is scoped to*— the code comment notes the action does not support resource-level permissions — so enabling the flag also drops a wildcard permission. Worth knowing, since it argues for enabling it.AwsCustomResourceprovider Lambda and its role are removed only if nothing else in the stack still usesAwsCustomResource. That function is a per-stack singleton keyed onPROVIDER_FUNCTION_UUID, so stating unconditionally that the Lambda disappears would be wrong for most real stacks.Also adds
compatibilityWithOldBehaviorMd, which this flag was missing. It is optional forFlagType.BugFixand ten existingBugFixflags already set it.The
FlagTypeis deliberately left asBugFix. Enabling really does change the synthesized template, so the classification is correct; what was missing was the detail needed to judge it. Happy to reconsider if maintainers would rather reclassify.FEATURE_FLAGS.mdis regenerated fromfeatures.ts. No code or behaviour change.Describe any new or updated permissions being added
None. The change is documentation only. It does describe an existing permission — the
cognito-idp:DescribeUserPoolDomainstatement that the custom resource creates — but does not add or alter one.Description of how you validated changes
No unit or integration tests, as no code changed.
UserPoolDomainTarget.bindfor the branch,cloudFrontEndpointandcloudFrontDomainNamefor the two mechanisms, andAwsCustomResourcefor the singleton provider function.FEATURE_FLAGS.mdregenerated withts-node --prefer-ts-exts ./cx-api/build-tools/flag-report.ts; re-running it produces no further diff.recommended-feature-flags.jsonis untouched, asrecommendedValuedid not change.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license