English 中文(简体)
CDK v2 with HttpUrlIntegration route sub paths to the endpoint
原标题:
  • 时间:2023-08-04 03:00:25
  •  标签:
  • aws-cdk

Is there anyway using the following

const api = new apigatewayv2.HttpApi(this,  ProxyAPI , {});
api.addRoutes({
    path:  /proxy ,
    methods: [ apigatewayv2.HttpMethod.ANY ],
    integration: new HttpUrlIntegration( ProxyIntegration ,  https://httpbin.org/anything ),
    authorizer: authorizerIAM,
});

This works fine

https://xxxx.execute-api.us-west-2.amazonaws.com/proxy

I also want this to work

https://xxxx.execute-api.us-west-2.amazonaws.com/proxy/foo

I d want that to hit https://httpbin.org/anything/foo

Thanks

I ve tried the following

api.addRoutes({
    path:  /proxy ,
    methods: [ apigatewayv2.HttpMethod.ANY ],
    integration: new HttpUrlIntegration( ProxyIntegration ,  https://httpbin.org/anything ),
    authorizer: authorizerIAM,
});
问题回答

暂无回答




相关问题
如何在其他CDK资源中使用CDK资源的ARN

我有一个AWS CDK堆栈,其中包含一个Step Functions状态机和一个lambda函数。此lambda函数使用StartExecution API,该API需要状态机的ARN。我不知道。。。

How can I bundle Typescript AppSync resolvers in the CDK?

AppSync GraphQL resolvers can be written in JavaScript instead of VTL. AppSync has dev-time helpers for TypeScript resolvers, but we must bundle the code ourselves. How can I bundle .ts resolvers in ...

Why does vpc comes out from aws-cdk-lib/aws-ec2 ?

Please understand that I m a newbie, just starting to learn the CDK and AWS networks. While configuring a VPC using the CDK, I came across the code below. import * as cdk from aws-cdk-lib ; import * ...

热门标签