0
使用代码管道创建Lambda函数(POST)和相应的API网关。默认情况下,API网关是使用lambda代理类型集成创建的。 SAM中我应该给出的参数是使用Non Lambda Proxy类型集成创建的。在CodePipeline中创建非Lambda代理AWS API网关
以下是我的SAM模板。
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
请告知
因此,如果在我的SAM中创建了一个Lambda函数资源及其对应的API资源,而不是在Lambda函数中内联设置API事件类型,那么它是否合理。当我从外界调用我的API时,它最终将调用API资源中定义的Lambda。 – Rohit