我正在将以下 SAM 模板用于 lambda 函数
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
GetFunction:
Type: AWS::Serverless::Function
Properties:
Handler: handler.get
Runtime: nodejs6.10
Environment:
Variables:
S3_BUCKET: bucket
Events:
GetResource:
Type: Api
Properties:
Path: /resource/{resourceId}
Method: get
我对“事件”部分有点困惑。当我部署它时,lambda 函数创建得很好,但是由于我在事件下提到了 Api,所以我希望它创建一个 API 网关。但是,当我导航到 API Gateway 部分 https://console.aws.amazon.com/apigateway/ 时我没有看到创建任何 API 网关。当我导航到 CloudFormation 堆栈并查看模板时,它显示了 API 网关,但没有显示正在创建的 API 网关。我在这里缺少什么?
最佳答案
关于amazon-web-services - AWS SAM 模板创建 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47086527/