-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the issue
The current documentation for the @aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource feature flag doesn't provide any information about the migration path from the old default to the new.
From what I can tell, the old Custom Resource just looked up the domain name, which is now exposed through a direct CloudFormation export:
aws-cdk/packages/aws-cdk-lib/aws-cognito/lib/user-pool-domain.ts
Lines 162 to 193 in db62c5f
| /** | |
| * The domain name of the CloudFront distribution associated with the user pool domain. | |
| * | |
| * This method creates a custom resource internally to get the CloudFront domain name. | |
| * | |
| * @deprecated use `cloudFrontEndpoint` method instead. | |
| */ | |
| public get cloudFrontDomainName(): string { | |
| if (!this.cloudFrontCustomResource) { | |
| const sdkCall: AwsSdkCall = { | |
| service: 'CognitoIdentityServiceProvider', | |
| action: 'describeUserPoolDomain', | |
| parameters: { | |
| Domain: this.domainName, | |
| }, | |
| physicalResourceId: PhysicalResourceId.of(this.domainName), | |
| }; | |
| this.cloudFrontCustomResource = new AwsCustomResource(this, 'CloudFrontDomainName', { | |
| resourceType: 'Custom::UserPoolCloudFrontDomainName', | |
| onCreate: sdkCall, | |
| onUpdate: sdkCall, | |
| policy: AwsCustomResourcePolicy.fromSdkCalls({ | |
| // DescribeUserPoolDomain only supports access level '*' | |
| // https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncognitouserpools.html#amazoncognitouserpools-actions-as-permissions | |
| resources: ['*'], | |
| }), | |
| // APIs are available in 2.1055.0 | |
| installLatestAwsSdk: false, | |
| }); | |
| } | |
| return this.cloudFrontCustomResource.getResponseField('DomainDescription.CloudFrontDistribution'); | |
| } |
And the feature flag just changes this reference:
| public bind(record: IRecordSet, _zone?: IHostedZone): AliasRecordTargetConfig { | |
| const dnsName = FeatureFlags.of(record).isEnabled(USER_POOL_DOMAIN_NAME_METHOD_WITHOUT_CUSTOM_RESOURCE) | |
| ? this.domain.cloudFrontEndpoint | |
| : this.domain.cloudFrontDomainName; | |
| return { | |
| dnsName, | |
| hostedZoneId: CloudFrontTarget.getHostedZoneId(this.domain), | |
| }; | |
| } | |
| } |
So I'm a bit confused why this is described as a "breaking change" in the docs. I made this update to a few projects of mine and the update of the Route53 record was transparent and didn't cause any downtime or problem.
Could we clarify the documentation to make this sound less scary?
Links
aws-cdk/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
Lines 1747 to 1762 in db62c5f
| ### @aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource | |
| *When enabled, use a new method for DNS Name of user pool domain target without creating a custom resource.* | |
| Flag type: Backwards incompatible bugfix | |
| When this feature flag is enabled, a new method will be used to get the DNS Name of the user pool domain target. The old method | |
| creates a custom resource internally, but the new method doesn't need a custom resource. | |
| If the flag is set to false then a custom resource will be created when using `UserPoolDomainTarget`. | |
| | Since | Default | Recommended | | |
| | ----- | ----- | ----- | | |
| | (not in v1) | | | | |
| | 2.174.0 | `false` | `true` | |