Aws-sam-cli: sam package does not upload lambda layer zip file

Created on 5 Dec 2018  路  1Comment  路  Source: aws/aws-sam-cli

Description:
When packaging a template that includes AWS::Serverless::LayerVersion, sam does not upload the code to s3 and insert the s3 location
It should work as described here:
https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlesslayerversion

Steps to reproduce the issue:
add AWS::Serverless::LayerVersion resource and specify location of the code for ContentUri like this:

  LibraryLayer:
    Type: "AWS::Serverless::LayerVersion"
    Properties:
      Description: Runtime dependencies layer
      ContentUri: ./librarylayer.zip
      CompatibleRuntimes:
        - python3.6
      RetentionPolicy: Delete

then run sam package against it
Observed result:

  LibraryLayer:
    Type: "AWS::Serverless::LayerVersion"
    Properties:
      Description: Runtime dependencies layer
      ContentUri: ./librarylayer.zip
      CompatibleRuntimes:
        - python3.6
      RetentionPolicy: Delete

Expected result:
sam should upload the layer code to s3 and insert the location

  LibraryLayer:
    Type: "AWS::Serverless::LayerVersion"
    Properties:
      Description: Runtime dependencies layer
      ContentUri: s3://bucket/prefix/object
      CompatibleRuntimes:
        - python3.6
      RetentionPolicy: Delete

Most helpful comment

See comment

"SAM CLI shells out to AWS CLI for package and deploy. Therefore you need to update AWS CLI to a min version of 1.16.67. "

Closing

>All comments

See comment

"SAM CLI shells out to AWS CLI for package and deploy. Therefore you need to update AWS CLI to a min version of 1.16.67. "

Closing

Was this page helpful?
0 / 5 - 0 ratings