Testing locally with Lambda function using layer from serverless repo

Viewed 201

I'm writing a lambda function using python which requires a layer from the serverless repo.

The resource below is defined in my SAM template for this layer:

  LambdaLayer:
    Type: AWS::Serverless::Application
    Properties:
      Location:
        ApplicationId: arn:aws:serverlessrepo:us-east-1:903779448426:applications/lambda-layer-kubectl
        SemanticVersion: 2.0.0
      Parameters:
        LayerName: kubectl

This works perfectly when I deploy my solution to AWS, but I'd like to be able to test my function locally. Is it possible to cache or pull these layers locally to do testing, and is it possible to do this for CI builds, too? Is it possible to stub methods for testing?

0 Answers
Related