Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-sam

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-sam

Serverless framework plugin to export AWS SAM templates for a service

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 08 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc