1.1.3 • Published 4 years ago

@tgingras-hs/yadu v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

YaDU (Yet another Deployment Utility)

THIS IS STILL A WORK IN PROGRESS

This utility reads the serverless.json file and publishes lambda on AWS.

Usage

cwd=$(PWD)
export AWS_PROFILE=default
export AWS_REGION=us-east-1

cd ../../lambda/your-lambda/

node $cwd/publish.js
npm install -g @tommygingras/yadu
yadu --help

Configuration

For the zipArgs noticed the lowercase z, this is intended

Do not add extra parameters, I have to update a script to avoid errors.  So let me know if you need extra params,  It will be my pleasure to update the scripts.

Complete Example:

{
    "FunctionName": "integration-template",
    "Description": "This is a template for devops integration",
    "Code": "./_integration/index.zip",
    "Handler": "index.handler",
    "Runtime": "nodejs12.x",
    "MemorySize": 128,
    "Timeout": 3,
    "Layers": [
        "LAYER_ARN"
    ],
    "zipArgs": "*.js package.json *.html node_modules",
    "Environment": {
        "FOO": "BAR",
        "BAR": "FOO"
    },
    "Role": "LAMBDA_ROLE_ARN",
    "Events": {
        "dev": {
            "EventSourceArn": {
                "Fn::Sub": "arn:aws:sqs:${AWS::Region}:${AWS::AccountId}:sqs_example_dev"
            },
            "BatchSize": 10,
            "Enabled": true
        }
    },
    "Permissions": {
        "dev": [
            {
                "Type": "AWS::Lambda::Permission",
                "Properties": {
                    "Action": "lambda:InvokeFunction",
                    "FunctionName": {
                        "Fn::Sub": "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:FUNCTION_NAME:dev"
                    },
                    "Principal": "apigateway.amazonaws.com",
                    "SourceArn": {
                        "Fn::Sub": "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:*/*"
                    }
                }
            }
        ]
    }
}

Planning

  • The zip command should be configurable in the serverless.json file to allow custom implementation.
  • Add the --environment argument
  • Add the --role argument
1.1.1

4 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.8

4 years ago