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