publish-go-lambda

command module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 23 Imported by: 0

README

publish-go-lambda

Command publish-go-lambda is a shortcut program that builds Go source in the current directory and publishes it as an existing AWS Lambda (Go 1.x runtime). It automatically discovers what "handler name" AWS Lambda has configured.

It is an equivalent of:

# build program
GOOS=linux GOARCH=amd64 go build -o main

# create zip file with the proper handler name
zip lambda.zip main

# upload resulting zip to AWS Lambda

This program applies some safety checks by default: it checks that the main package imports github.com/aws/aws-lambda-go/lambda dependency, and that package documentation mentions (short) lambda name.

Call it with the full resource ARN:

publish-go-lambda arn:aws:lambda:us-west-2:123456789012:function:my-function

partial ARN:

publish-go-lambda 123456789012:function:my-function

or with just the short function name:

publish-go-lambda my-function

This program requires permissions to GetFunctionConfiguration and UpdateFunctionCode AWS APIs.

Documentation

Overview

Command publish-go-lambda builds Go source in the current directory and publishes it as an existing AWS Lambda (Go 1.x runtime).

Jump to

Keyboard shortcuts

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