aws_apigateway: obtain DomainName instead of IDomainName #28203
Labels
@aws-cdk/aws-apigateway
Related to Amazon API Gateway
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Make it possible to retrieve the DomainName from the arn. Now it is only possible on retrieving the IDomainName, not the DomainName.
Use Case
With apigateway v1 it is possible to add Api Mappings to a certain stage in your API gateway. This feature is recently added and ported from apigateway v2.
The addApiMapping method can be used on the DomainName. When the DomainName is created in another stack, and shared inside a project, we only can get the IDomainName and not the DomainName. The IDomainName is retrieved using the following code:
const domainName = DomainName.fromDomainNameAttributes(this, "DomainName", { domainName: xxx, domainNameAliasHostedZoneId: yyy, domainNameAliasTarget: zzz, });
As this is returning an IDomainName I can not perform addApiMapping on it.
Proposed Solution
It would be nice if we could do
const domainName: DomainName = DomainName.fromAttributes(this, "att", { domainNameArn: "arn:xxx:xxx:xxx" })
Other Information
No response
Acknowledgements
CDK version used
2.111.0
Environment details (OS name and version, etc.)
Mac
The text was updated successfully, but these errors were encountered: