0.1.1 • Published 4 years ago

aws-lambda-golang v0.1.1

Weekly downloads
42
License
Apache-2.0
Repository
github
Last release
4 years ago

GitHub version npm version NuGet version PyPI version

Amazon Lambda Golang Construct

This library provides constructs for Golang (Go 1.11 and 1.12 because of go modules) Lambda functions.

Installing

In Typescript:

npm i aws-lambda-golang --save
# or using yarn
yarn add aws-lambda-golang

In .NET:

dotnet add package rwilinski.GolangFunction --version 0.1.0

In Python using Pip:

pip install rwilinski.aws-lambda-golang

In Java using Maven:

Usage

In Typescript:

import * as golang from 'aws-lambda-golang';

...

new golang.GolangFunction(this, 'my-handler');

By default, the construct will use the name of the defining file and the construct's id to look up the entry file:

.
├── stack.ts # defines a 'GolangFunction' with 'my-handler' as id
├── stack/my-handler/main.go 
├── stack/my-handler/go.mod 
├── stack/my-handler/go.sum 

Configuring build

The GolangFunction construct exposes some options via properties: buildCmd, buildDir, entry and handler, extraEnv.

By default, your Golang code is compiled using go build -ldflags="-s -w" command with GOOS=linux env variable.

Project sponsored by Dynobase