0

Created the Lambda Function (POST) and corresponding API Gateway using Code Pipeline. By default the API Gateway got created with lambda Proxy type integration. What parameters in SAM I should give that my API Gateway gets created with Non Lambda Proxy type Integration.

Below is my SAM Template.

AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-  31 Description: Outputs the time Resources: TimeFunction: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs6.10 CodeUri: ./ Events: MyTimeApi: Type: Api Properties: Path: /TimeResource Method: GET CalculatorFunction: Type: AWS::Serverless::Function Properties: Handler: calc.calculator Runtime: nodejs6.10 CodeUri: ./ Events: MyCalculatorApi: Type: Api Properties: Path: /Calculator Method: POST

Please advise

4

1 回答 1

0

AWS::Serverless::Api如果您使用该资源,您应该能够定义您想要的任何 Swagger 定义。在我们的开发人员指南中有 swagger 定义的示例,您还可以从 Stages 页面将现有 API 导出到 swagger。在这种情况下, Swagger 中结构type上的字段x-amazon-apigateway-integration应该是aws而不是aws_proxy.

当您在 SAM 的 Lambda 函数上内联设置 API 事件类型时,无法设置此字段。

于 2017-06-05T16:55:24.753 回答