大家好,AWS Cloudformation 人员!
尝试 sam 部署 我的 api 网关时,我遇到以下错误。 我将 api 网关端点定义为 openapi yaml (api.yaml) 文件,并将其附加到 template.yaml 中的 api 网关定义DefinitionBody 属性。
Resource handler returned message: "No integration defined for method
(Service: ApiGateway, Status Code: 400, Request ID:
84d74c87-d8b4-476f-a717-f8a885f78f05)" (RequestToken:
295d3709-e28c-4254-08b1-317f56af6532, HandlerErrorCode: InvalidRequest)
我必须缺少什么?
- 我在 api.yaml 文件中只有 1 个 api 定义。 yaml 中没有未使用的 api。
- 我在 template.yaml 中只定义了 1 个 lambda 函数
我提到了No integration defined for method - Choose a stage where your API will be deployed ,在发布此内容之前!
谢谢!
最佳答案
如果不查看 template.yaml 文件,很难知道原因。如果您可以使用模板的部分内容编辑问题,将会很有帮助。
但是,该错误通常意味着 API 网关和 Lambda 函数之间的集成可能缺失。你刚才提到的问题也反射(reflect)了同样的情况。 API 网关定义中可能有一个 API 方法缺少 lambda 函数的链接。
关于aws-cloudformation - 没有为方法定义集成(服务 : ApiGateway, 状态代码:400),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75614255/