AWS SAM函数AutoPublishAlias“无效的函数版本”

时间:2019-12-05 15:19:53

标签: amazon-web-services aws-lambda amazon-cloudformation aws-sam

我正在使用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控制台“别名”菜单的屏幕截图:

enter image description here

1 个答案:

答案 0 :(得分:1)