lambda-phage

command module
v0.0.0-...-db51a79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2015 License: MIT Imports: 24 Imported by: 0

README

lambda-phage

a tool for deploying to aws lambda

Installation

go get github.com/hopkinsth/lambda-phage

Getting Started

lambda-phage is a tool that aims to make deploying code to AWS Lambda easier without needing CloudFormation et al. To get started, run init inside the folder that has the code you want to run in Lambda:

$ lambda-phage init

The init command will ask you several questions about your AWS setup and save a configuration file (named l-p.yml by default) to keep the options you define.

Once you've set configuration, all you need to do is run the deploy command to deploy:

$ lambda-phage deploy

This will package all the files in the current directory, recursively, into a ZIP file and upload it to AWS Lambda.

lambda-phage uses Amazon's official Go SDK, so you can set API credentials in any way that the Go SDK supports, including a local credential file and environment variables. If you're getting set up for the first time, please read Amazon's guide to setting up their own AWS CLI tools, which describes how to set up a local credential file.

Project Support

lambda-phage can organize your lambda functions into projects for easier deployment. To create a project, use the project create command:

$ lambda-phage project create my-project-name

You can then add the current working directory to the project:

$ lambda-phage project add my-project-name

Finally, you can deploy all the functions in a project with project deploy:

# deploy all functions in the project
$ lambda-phage project deploy my-project-name

# deploy functions matching a pattern
$ lambda-phage project deploy --filter '.*frontend' my-project-name

# perform a project deploy dry run, only printing what would be deployed
# rather than actually deploying it
$ lambda-phage project deploy --dry-run my-project-name

TODO:

  • real tests (tdd be damned i guess?)
  • add project import command to interactively load suggested project names based on whatever's in config YAML
  • add support for configuring event sources through init
    • potential blocker is lack of API gateway API client, though we might be able to do it anyway
    • can at least support streams (dynamoDB + kinesis), s3, cloudwatch event sources

Usage


     ,-^-.
     |\/\|
     '-V-'
       H
       H
       H
    .-;":-.
   ,'|  '; \

Usage:
  lambda-phage [command]

Available Commands:
  deploy      deploys your lambda function according to your config file or options provided
  init        initializes a config for your function
  pkg         adds all the current folder to a zip file recursively
  project     does project stuff

Flags:
  -c, --config="l-p.yml": config file location
  -v, --verbose[=false]: verbosity

Use "lambda-phage [command] --help" for more information about a command.

Configuration Format

This tool stores its config in a YAML file named l-p.yml by default. Here's a quick sample:

name: my-first-lambda-function
description: provides some sample stuff
archive: my-first-lambda-function.zip
entryPoint: index.handler
memorySize: 128
runtime: nodejs
timeout: 5
regions: [us-east-1]
iamRole:
  # if present, 
  # ARN takes precedence over name
  arn: aws
  name: lambda_basic_execution
location:
  # omit S3 configuration to upload
  # directly to Lambda
  s3bucket: test-bucket
  s3key: my-first-function/
  s3region: us-east-1
  s3ObjectVersion: myversion

Credits?

The bacteriophage ASCII art might come from someone with the handle 'itz'! Not sure! I removed their signature from the text and credit them here. If you're itz, please get in touch; you made some cool-looking virus ASCII.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/aws/aws-sdk-go/aws
Package aws provides core functionality for making requests to AWS services.
Package aws provides core functionality for making requests to AWS services.
_workspace/src/github.com/aws/aws-sdk-go/aws/awserr
Package awserr represents API error interface accessors for the SDK.
Package awserr represents API error interface accessors for the SDK.
_workspace/src/github.com/aws/aws-sdk-go/aws/credentials
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds
Package stscreds are credential Providers to retrieve STS AWS credentials.
Package stscreds are credential Providers to retrieve STS AWS credentials.
_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints
Package endpoints validates regional endpoints for services.
Package endpoints validates regional endpoints for services.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/json/jsonutil
Package jsonutil provides JSON serialisation of AWS requests and responses.
Package jsonutil provides JSON serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/jsonrpc
Package jsonrpc provides JSON RPC utilities for serialisation of AWS requests and responses.
Package jsonrpc provides JSON RPC utilities for serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query
Package query provides serialisation of AWS query requests, and responses.
Package query provides serialisation of AWS query requests, and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest
Package rest provides RESTful serialization of AWS requests and responses.
Package rest provides RESTful serialization of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/restjson
Package restjson provides RESTful JSON serialisation of AWS requests and responses.
Package restjson provides RESTful JSON serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/restxml
Package restxml provides RESTful XML serialisation of AWS requests and responses.
Package restxml provides RESTful XML serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil
Package xmlutil provides XML serialisation of AWS requests and responses.
Package xmlutil provides XML serialisation of AWS requests and responses.
_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4
Package v4 implements signing for AWS V4 signer
Package v4 implements signing for AWS V4 signer
_workspace/src/github.com/aws/aws-sdk-go/service/iam
Package iam provides a client for AWS Identity and Access Management.
Package iam provides a client for AWS Identity and Access Management.
_workspace/src/github.com/aws/aws-sdk-go/service/iam/iamiface
Package iamiface provides an interface for the AWS Identity and Access Management.
Package iamiface provides an interface for the AWS Identity and Access Management.
_workspace/src/github.com/aws/aws-sdk-go/service/lambda
Package lambda provides a client for AWS Lambda.
Package lambda provides a client for AWS Lambda.
_workspace/src/github.com/aws/aws-sdk-go/service/lambda/lambdaiface
Package lambdaiface provides an interface for the AWS Lambda.
Package lambdaiface provides an interface for the AWS Lambda.
_workspace/src/github.com/aws/aws-sdk-go/service/s3
Package s3 provides a client for Amazon Simple Storage Service.
Package s3 provides a client for Amazon Simple Storage Service.
_workspace/src/github.com/aws/aws-sdk-go/service/s3/s3iface
Package s3iface provides an interface for the Amazon Simple Storage Service.
Package s3iface provides an interface for the Amazon Simple Storage Service.
_workspace/src/github.com/peterh/liner
Package liner implements a simple command line editor, inspired by linenoise (https://github.com/antirez/linenoise/).
Package liner implements a simple command line editor, inspired by linenoise (https://github.com/antirez/linenoise/).
_workspace/src/github.com/russross/blackfriday
Blackfriday markdown processor.
Blackfriday markdown processor.
_workspace/src/github.com/shurcooL/sanitized_anchor_name
Package sanitized_anchor_name provides a func to create sanitized anchor names.
Package sanitized_anchor_name provides a func to create sanitized anchor names.
_workspace/src/github.com/spf13/cobra
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
_workspace/src/github.com/spf13/pflag
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
_workspace/src/github.com/vaughan0/go-ini
Package ini provides functions for parsing INI configuration files.
Package ini provides functions for parsing INI configuration files.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL