Description
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
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.111.0
Environment details (OS name and version, etc.)
Mac