0.1.1 • Published 6 years ago
aws-lambda-golang v0.1.1
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-golangIn .NET:
dotnet add package rwilinski.GolangFunction --version 0.1.0In Python using Pip:
pip install rwilinski.aws-lambda-golangIn 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