-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/aws-cognitoRelated to Amazon CognitoRelated to Amazon Cognitoeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2
Description
Describe the feature
Currently we use an AwsCutstomResource to get cloudFrontDomainName
attribute for a UserPoolDomain resource.
aws-cdk/packages/aws-cdk-lib/aws-cognito/lib/user-pool-domain.ts
Lines 129 to 136 in 4b9643f
public get cloudFrontDomainName(): string { | |
if (!this.cloudFrontCustomResource) { | |
const sdkCall: AwsSdkCall = { | |
service: 'CognitoIdentityServiceProvider', | |
action: 'describeUserPoolDomain', | |
parameters: { | |
Domain: this.domainName, | |
}, |
But actually CFn exposes the attribute natively. We can remove the unnecessary custom resource usage.
Use Case
To get a CloudFront domain for a user pool domain without using a custom resource. c.f. https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html
Proposed Solution
We can just replace it with a getAtt
call.
public get cloudFrontDomainName(): string {
return resource.getAtt('CloudFrontDistribution').toString(),
}
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.155.0
Environment details (OS name and version, etc.)
macOS
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cognitoRelated to Amazon CognitoRelated to Amazon Cognitoeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2