-
Notifications
You must be signed in to change notification settings - Fork 4k
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: Use existing RestAPI to create CloudFront distribution #32332
Comments
Hi @cyberworkz , thanks for reaching out. I see this property for defining s deploymentStage name, are you referring to this-
|
I also tried an alternate approach to see if that works but it also fails - # importing existing RESTAPI
rest_api = apigateway.RestApi.from_rest_api_id(self, "MyExistingApi", "54rrn5bns0")
api_stage = rest_api.deployment_stage("prod")
# create CloudFrontDistribution with APIGateway as origin
cloudfront_dist = cloudfront.Distribution(self, "MyCloudFrontDist",
default_behavior=cloudfront.BehaviorOptions(
origin=origins.HttpOrigin(api_stage.invoke_url)
)
) Error received-
Since your suggestion of this FR might be breaking change, I would reach out to core team for getting their thoughts on implementation perspective and share their insights as well. |
Thanks @khushail for looking into this. How can I reach out to core team with this issue? |
@cyberworkz , I have already added this issue to the Project board and requesting inputs from the On-call. Should be able to get feedback soon. |
Describe the feature
Current AWS CDK does not give the possibility to use an existing RestAPI (RestApiBase) to create a stack for Cloudfront distributions. Add a static method to RestApiBase to refer to an existing RestApi and a certain stage.
Use Case
I have some existing RestApi's in the API Gateway. I want to use a Cloudfront distribution for them and use AWS CDK to create these distributions.
Proposed Solution
The current code is missing fields to properly determine all necessary info. Include stage-name for creating a RestApiBase will probably help.
This code fails:
Other Information
I am trying to use a proxy-lambda with apigateway integration to connect to a cloudfront distribution.
Acknowledgements
CDK version used
2.171.0
Environment details (OS name and version, etc.)
Apple M1 Max Macos Sequoia 15.1.1 (24B91)
The text was updated successfully, but these errors were encountered: