问题描述
我正在尝试为通过 SAM 模板创建的 API 网关提供一个客户名称。 并且还限制在部署时只创建一个阶段。
AWstemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An AWS Serverless Specification template describing your function.
Resources:
ApiGatewayApi:
Type: AWS::Serverless::Api
Properties:
StageName: Development
Cors: "'*'"
GetAllUser:
Type: AWS::Serverless::Function
Properties:
FunctionName: loadeo_get_all_user
CodeUri: code/
Handler: get_all_user.lambda_handler
Timeout: 5
Runtime: python3.8
Role: lambda_execution
MemorySize: 128
Events:
GetAllUser:
Type: Api
Properties:
Path: /get-all-user
Method: get
RestApiId:
Ref: ApiGatewayApi
一切都如我所愿,但
我如何实现这两种情况?