I have read that SAM cli now supports building layers and followed the directions mentioned [here](https://github.com/awslabs/aws-sam-cli/releases/tag/v0.50.0). However, the layer uploaded by aws-sam-deploy pipe is missing `node_modules` folder.
Here is my template file:
AWSTemplateFormatVersion: 2010-09-09
Description: >-
sam-deploy
Transform:
- AWS::Serverless-2016-10-31
Resources:
samDeploy:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/sam-deploy
Handler: index.handler
Runtime: nodejs12.x
MemorySize: 128
Timeout: 100
Description: A Lambda function that returns a static string.
FunctionName: "sam-deploy"
Layers:
- !Ref samDeployLayer
Policies:
# Give Lambda basic execution Permission to the helloFromLambda
- AWSLambdaBasicExecutionRole
samDeployLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: sam-deploy-layer
ContentUri: src/sam-deploy-layer
CompatibleRuntimes:
- nodejs12.x
Metadata:
BuildMethod: nodejs12.x
I have included both the `CompatibleRuntimes` and `Metadata` properties as per the requirement to build layers. `package.json` for this layer is located at `src/sam-deploy-layer/nodejs` as required for nodeJS runtimes.
[EDIT put into a comment]
@Adarsh Kurudi we have released new version with bumped aws-sam-cli to 0.53.0. Welcome to check it out
Best regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any progress on this issue? I have an AWS SAM template with a `Metadata.BuildMethod` which also doesn't work (as if the `Metadata.BuildMethod` section of the resource is being ignored).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@nasfarley88 we have updated aws-sam-cli.
Please, share your pipeline, the part of aws-sam-deploy usage, and the template (you may put some sensitive things as hidden, but we need a template to understamd the exact case of failing and see the structure you're using).
We will investigate your case separately and notify you.
Regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Adarsh Kurudi ,
thank you for your feedback!
We'll investigate updates to the new aws-sam-cli version and notify you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.