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
[apigateway] Allow import of API Gateway Resource #4432
Comments
Hey @dehli, This seems like a reasonable feature request! It would be wonderful if you wanted to put in a PR for it, and I will make sure it is reviewed. That aside, someone should update this issue when there is progress. 😸 |
Hi CDK team and @dehli, Has there been any progress on this issue, as we are currently facing the same problems. |
See also #1477 which has more discussion and workaround code. |
feat(apigateway): add fromResourceAttribute helper for importing Resource closes #4432 NOTE: No change in Readme is done since I was not able to find a good place for it in the Readme. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
feat(apigateway): add fromResourceAttribute helper for importing Resource closes aws#4432 NOTE: No change in Readme is done since I was not able to find a good place for it in the Readme. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
It would be great if we could add a
Resource.fromResourceId
for API Gateway resources. I could imagine it looking something like this:Use Case
We have existing CloudFormation infrastructure that we're integrating with CDK and it would be great to utilize
Resource
without having to always useCfnResource
.Proposed Solution
I'd imagine it would behave similarly to
Role.fromRoleArn()
orRestApi.fromRestApiId()
. Will try to get a PR created but wanted to open this issue in case there was a reason it doesn't exist yet.My initial solution creates a class like below:
Currently I have
restApi
as anIRestApi
instead of a regularRestApi
because that's the return value ofRestApi.fromRestApiId()
. I'll need to do some work to figure out the proper typing.Edit: Looks like calling
addMethod
when usingIRestApi
doesn't work because there's no stage associated with the API.This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: