Skip to main content

CDK Construct for AWS Lambda in Golang

Project description

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:

</code></pre>
<h3>Usage</h3>
<p>In Typescript:</p>
<pre lang="python"><code># Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_lambda_golang as golang

golang.GolangFunction(self, "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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rwilinski.aws-lambda-golang-0.1.1.tar.gz (22.4 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page