Skip to content

aws_apigateway: obtain DomainName instead of IDomainName #28203

Open
@stefdaems

Description

@stefdaems

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-apigatewayRelated to Amazon API Gatewayeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions