(aws-apigatewayv2): add routes to imported httpapi (IHttpApi)
See original GitHub issueAllow routes to be added to an existing HttpApi. Currently this is not an option
Use Case
We currently have an api gateway connected to an alb via vpclink on the default route and are slowly peeling off services and converting them to lambdas. This is easily done by defining explicit routes for our services as we move them over. The problem is that these new services are built and managed in their own cdk projects (deployed via codepipeline cdk stacks in their projects) but since the api gateway is defined elsewhere it needs to be imported to add the routes.
It looks like the only option we have currently would be to move all rest service stacks into the project the api gateway is in but this will quickly lead to a bloated and inefficient build/deploy process
Proposed Solution
allow routes to be added on IHttpApi or provide some other way to import an existing gateway and add routes
const api = HttpApi.fromHttpApiAttributes(this, 'gateway', {
httpApiId: 'myGateway',
});
api.addRoutes({
path,
methods,
integration,
});
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 3 years ago
- Reactions:28
- Comments:10 (1 by maintainers)
Top GitHub Comments
Thanks for filing this request.
In the meantime, you can achieve this by using our lower level constructs, specifically
CfnRoute
.+2 months later. Any update on this?