简体   繁体   中英

aws sam build failing: property SnapStart not defined for resource of type AWS::Serverless::Function

AWS sam build failing after adding SnapStart property in function yaml file.

 [InvalidResourceException('MyFunSnapstart', 'property SnapStart not defined for resource of type AWS::Serverless::Function'), InvalidResourceException('MyFunLamdaFunSnapstart', 'property SnapStart not defined for resource of type AWS::Serverless::Function')] ('MyFunSnapstart', 'property SnapStart not defined for resource of type AWS::Serverless::Function') ('MyFunSnapstart', 'property SnapStart not defined for resource of type AWS::Serverless::Function')

template.yaml file code:

  MyFunSnapstart:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: my-lamda-fun
      Handler: com.poc.lambda.handler.MyLambda::handleRequest
      Role: !GetAtt LambdaExecutionRole.Arn
      SnapStart:
        ApplyOn: PublishedVersions
      Events:
        MyEvent:
          Type: Api
          Properties:
            Path: /api/snapstart/hello
            RestApiId: !Ref MyRestApi
            Method: GET

My sam cli version is: SAM CLI, version 1.65.0

SAM CLI actually released version 1.66 around an hour ago with support for this new property: https://github.com/aws/aws-sam-cli/releases/tag/v1.66.0 (and PyPI ), so if you update now it should work correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM