aws-lambda-golang
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Package Sidebar

Install

npm i aws-lambda-golang

Weekly Downloads

2

Version

0.1.1

License

Apache-2.0

Unpacked Size

47.3 kB

Total Files

12

Last publish

Collaborators

  • rwilinski