Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_apigateway: obtain DomainName instead of IDomainName #28203

Open
2 tasks
stefdaems opened this issue Nov 30, 2023 · 1 comment
Open
2 tasks

aws_apigateway: obtain DomainName instead of IDomainName #28203

stefdaems opened this issue Nov 30, 2023 · 1 comment
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

Comments

@stefdaems
Copy link

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

@stefdaems stefdaems added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 30, 2023
@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Nov 30, 2023
@stefdaems stefdaems changed the title (module name): (short issue description) aws_apigateway: obtain DomainName instead of IDomainName Nov 30, 2023
@stefdaems
Copy link
Author

I'm getting it to work when using the apigatewayv2.CfnApiMapping like

new apigatewayv2.CfnApiMapping(this, ApiMapping, {
apiId: theApiId,
domainName: theDomainName,
stage: theStageName,
apiMappingKey: theMultilevelBasePath,
});

@khushail khushail self-assigned this Dec 1, 2023
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Dec 1, 2023
@khushail khushail added p2 effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Dec 8, 2023
@khushail khushail removed their assignment Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants