Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Does aws-sam-deploy pipe support building layers?

Edited

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.

3 answers

[EDIT put into a comment]

 

0 votes

@Adarsh Kurudi  we have released new version with bumped aws-sam-cli  to 0.53.0. Welcome to check it out

 

Best regards, Galyna

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

@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

0 votes

Hi @Adarsh Kurudi ,

thank you for your feedback!

We'll investigate updates to the new aws-sam-cli version and notify you.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

233 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you