Ajay
Ajay

Reputation: 81

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

Upvotes: 1

Views: 931

Answers (1)

Renato
Renato

Reputation: 500

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.

Upvotes: 2

Related Questions