Last active
April 22, 2024 16:03
-
-
Save singledigit/7ad688e2424619e4ef1de5eafb90c79a to your computer and use it in GitHub Desktop.
How to create and manage a Lambda Layer using AWS SAM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Manage your Lambda layer in SAM | |
## This creates a layer and the permissions for the layer. This particular permission opens it to the world. | |
## I then use 'sam package' and 'sam deploy' to create/update the layer | |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Lambda Layer | |
Resources: | |
MyLayer: | |
Type: AWS::Serverless::LayerVersion | |
Properties: | |
LayerName: layer-name | |
Description: layer-description | |
ContentUri: layer/ ## Local folder containing layer contents | |
CompatibleRuntimes: ## Works with any of the supported languages | |
- nodejs8.10 | |
- nodejs10.x | |
LicenseInfo: 'MIT' | |
RetentionPolicy: Retain | |
AWSSDKLayerPermission: | |
Type: "AWS::Lambda::LayerVersionPermission" | |
Properties: | |
Action: lambda:GetLayerVersion | |
LayerVersionArn: !Ref MyLayer | |
Principal: '*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank's !