serverless-scotty

0.1.3 • Public • Published

Accelerate Your Serverless Development with AWS SAM & Scotty

Scotty is a simple tool that uploads your Lambda code without redeployment of the whole stack. Scotty parses your template.yaml file, gets all the serverless functions, zips the folders of these functions, uploads them to s3 and calls AWS API lambda.updateFunctionCode. Scotty helps you to accelerate your development! Instant development and deployment of your functions. No more waiting for the redeployment of the whole stack.

Step 1

Run npm i serverless-scotty inside the folder where your template.yaml is located.

Step 2

Add a command (see below) to your package.json file. Don't forget to update BUCKET_NAMEand the REGION

"scripts": {
    
    "scotty": "BUCKET_NAME=<bucket name> REGION=<region> node ./node_modules/.bin/scotty"
  },

Step 3

Important: Make sure your template.yaml doesn't contain short form cloudformation functions such as !Sub,!GetAttinstead use full function names such as Fn::Sub:, Fn:GetAtt.

Important: Each function needs to have an explicit FunctionName.

Here is an example that you can use

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An example for a template that works with scotty!

Globals:
    Function:
        Timeout: 3


Resources:

    HelloWorldFunction:
        Type: AWS::Serverless::Function 
        Properties:
            FunctionName: HelloWorldFunction # FunctionName needs to be explicitly passed here!!!
            CodeUri: hello_world/
            Handler: app.lambdaHandler
            Runtime: nodejs8.10
            Environment: 
                Variables:
                    PARAM1: VALUE
            Events:
                HelloWorld:
                    Type: Api 
                    Properties:
                        Path: /hello
                        Method: get

/serverless-scotty/

    Package Sidebar

    Install

    npm i serverless-scotty

    Weekly Downloads

    4

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    8.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • tarasowski