Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Does aws-sam-deploy pipe support building layers?

Adarsh Kurudi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 8, 2020

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

0 votes
nasfarley88
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 8, 2021

[EDIT put into a comment]

 

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2020

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

 

Best regards, Galyna

nasfarley88
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 8, 2021

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

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2021

@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
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2020

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

Atlassian Community Events