publish-go-lambda

command module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 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 (either Go 1.x or custom Amazon Linux 2 runtime). It automatically discovers "handler name" from AWS Lambda configuration.

AWS Lambda must either be configured with Go 1.x runtime (amd64 architecture only), or the custom runtime on Amazon Linux 2 (“provided.al2”) for either amd64 or arm64 architecture.

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 (either Go 1.x runtime or custom Amazon Linux 2 runtime).

Jump to

Keyboard shortcuts

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