I'm trying to add a HttpRoute in a HttpApi with the following features:
- a wildcard after the initial path: i'd like to proxy everything after "/foo" (such as "/foo", "/foo/bar" etc) to an ecs service (via HttpServiceDiscoveryIntegration, already set)
- a request mapping so that the path is correctly handled (I'm using stages for the Api)
Right now I've the following code:
new HttpRoute(scope, 'Route', {
httpApi,
routeKey: HttpRouteKey.with('/foo'),
integration: new HttpServiceDiscoveryIntegration({
service: service.cloudMapService!,
vpcLink: VpcLink.fromVpcLinkAttributes(scope, 'VpcLink', {
vpc,
vpcLinkId: 'aaa',
}),
}),
});
I can't find the right place to put the wildcard (if I put the wildcard inside the HttpRouteKey.with('/foo*')
it rises an error)
For what concerns the request mapping, I'd like to obtain what follows:
Thanks!!!
Found out CDK doesn't support what I wanted, so I used the Cfn classes: