我正在使用AWS SAM部署Lambda函数。部署函数时,我使用AutoPublishAlias
属性自动发布新版本,但是出现以下错误:Invalid function version 9. Function version 9 is already included in routing configuration. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 56b59a6b-6c57-434e-a505-ce7aa27c99b6)
。每次删除并创建堆栈时,都会成功创建该函数,但是当我尝试更新堆栈时,会出现错误。我还想知道为什么删除Lambda后版本号不是从1开始?
Lambda定义:
ApiLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub '${TagApplication}-${TagEnvironment}-api-lambda'
CodeUri: ../build
Handler: lambda.handler
MemorySize: 256
Role: !GetAtt LambdaExecutionRole.Arn
Runtime: nodejs10.x
Timeout: 30
AutoPublishAlias: 'live'
ProvisionedConcurrencyConfig:
ProvisionedConcurrentExecutions: '1'
AWS Lambda控制台“别名”菜单的屏幕截图:
答案 0 :(得分:1)
好像您还需要配置DeploymentPreference
属性-请参阅此链接-https://github.com/awslabs/serverless-application-model/issues/1296和https://github.com/jcts3/sam-pc-experiment/blob/master/template.yaml#L22