JSPM

aws-lambda-golang

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q34038F
  • License Apache-2.0

CDK Construct for AWS Lambda in Golang

Package Exports

  • aws-lambda-golang

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (aws-lambda-golang) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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