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
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
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