0
votes

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

1

1 Answers

0
votes

You should be able to define any Swagger definition you want if you use the AWS::Serverless::Api resource. There are examples of swagger definitions in our developer guide and you can also export your existing API to swagger from the Stages page. In this case, the type field on the x-amazon-apigateway-integration structure in Swagger should be aws rather than aws_proxy.

There is no way to set this field when you are setting the API Event type inline on the Lambda function in SAM.