aws-cloudformation - 没有为方法定义集成(服务 : ApiGateway, 状态代码:400)

标签 aws-cloudformation aws-api-gateway openapi aws-sam

大家好,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/

相关文章:

amazon-web-services - AWS API Gateway - 监控特定端点

maven - 在 OpenAPI 规范定义中使用 Artifact 版本号

amazon-web-services - `amplify push` 失败 - 属性 : StreamArn was not found for resource

amazon-web-services - 是否可以在 Cloud Formation 脚本中更改 RDS 实例的逻辑 ID?

javascript - 如何查看 serverless.yml 中解析的变量?

aws-cloudformation - 用存储桶名称替换变量

aws-lambda - 将 AWS Lambda 429 错误映射到 API Gateway 2XX 响应

amazon-web-services - AWS API 网关错误响应生成 502 "Bad Gateway"

java - Gradle 构建文件 org.openapi.generator openApiGenerate 列表生成器 openApiGenerators 无输出 无错误

swagger-ui - OpenAPI 3.0 文件格式在参数中给出了 allowedValues 周围的错误