Need help with serverless-sam?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

sapessi
145 Stars 26 Forks Apache License 2.0 41 Commits 19 Opened issues

Description

Serverless framework plugin to export AWS SAM templates for a service

Services available

!
?

Need anything else?

Contributors list

# 17,996
aws-lam...
lambda
Java
api-ser...
12 commits
# 411,386
JavaScr...
serverl...
aws-lam...
lambda
4 commits
# 386,426
JavaScr...
serverl...
aws-lam...
lambda
3 commits
# 245,998
serverl...
aws-lam...
lambda
aws-sam
3 commits
# 168,636
serverl...
lambda
CSS
kanban-...
1 commit
# 543,755
JavaScr...
serverl...
aws-lam...
lambda
1 commit
# 32,783
React N...
bittorr...
serverl...
HTML
1 commit
# 7,345
serverl...
Amazon ...
aws-lam...
F#
1 commit
# 543,756
JavaScr...
serverl...
aws-lam...
lambda
1 commit
# 158,043
serverl...
lambda
aws-sam
Erlang
1 commit
# 536,976
JavaScr...
serverl...
aws-lam...
lambda
1 commit

Serverless SAM Build Status

Serverless-sam is a plugin for the Serverless framework that makes it easy to create Serverless Application Model (SAM) templates from an application. The plugin adds the

sam
command to the serverless cli.

Installation

From your Serverless application directory, use

npm
to install the plugin:
$ npm install --save-dev serverless-sam

Once you have installed the plugin, add it to your

serverless.yml
file in the
plugins
sections.
service: my-serverless-service

plugins:

  • serverless-sam

frameworkVersion: ">=1.1.0 <2.0.0" ...

Usage

Use the

sam export
command to generate a SAM definition from your service. Use the
--output
or
-o
option to set the name for the SAM template file.
$ serverless sam export --output ./sam-template.yml

Once you have exported the template, you can follow the standard procedure with the AWS CLI to deploy the service. First, the package command reads the generated templates, uploads the packaged functions to an S3 bucket for deployment, and generates an output template with the S3 links to the function packages.

$ aws cloudformation package \
    --template-file /path_to_template/template.yaml \
    --s3-bucket bucket-name \
    --output-template-file packaged-template.yaml

The next step is to deploy the output template from the

package
command:
$ aws cloudformation deploy \
    --template-file /path_to_template/packaged-template.yaml \
    --stack-name my-new-stack \
    --capabilities CAPABILITY_IAM

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.