API 网关代理与 CDK 中的 lambda 函数集成

API gateway proxy integration with lambda function in CDK

当我如下设置 CDK 并部署它们时。这两个内容是在 api 网关中生成的。

    new LambdaRestApi(this,"api",{
      handler:lambdaFunction
    });

我完全是这种 API 操作的新手,有疑问。

①什么是{proxy+}

② 下面两个API有什么区别?

③ 如何查看将传递给 lambda 函数的负载?

如果有人有意见或材料请告诉我。

谢谢

proxy+ 的目的是使以下 URL 能够与您的函数一起使用:

https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage/some/path1/path3
https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage
https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage/test/gggg
https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage/test/5

没有 proxy+ 只有以下方法有效:

https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage

因此 proxy+ 能够接受 /test-invoke-stage 之后的所有内容,因为它匹配以 /test-invoke-stage.

开头的所有路径