Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
Farzad Senart edited this page Nov 16, 2016 · 5 revisions

Welcome to eawsy/aws-lambda-go - A fast and clean way to execute Go on AWS Lambda.

This wiki is the main source of documentation for developers working with or contributing to the project.

Summary

AWS Lambda lets you run code without provisioning or managing servers. For now it only supports Node.js, Python and Java. This project provides Go support without spawning a process.

Guide

Although not required, we recommand you review AWS Lambda Developer Guide first.

  • [Getting Started](Getting Started) - Create and test a simple Hello World Lambda function in Go.
  • [Programming Model](Programming Model) - Understand core concepts when authoring Lambda functions in Go.
  • [Deployment Package](Deployment Package) - Learn how to build and package a Lambda function in Go.

Preview

go get -u -d github.com/eawsy/aws-lambda-go/...
package main

import (
  "encoding/json"

  "github.com/eawsy/aws-lambda-go/service/lambda/runtime"
)

func handle(evt json.RawMessage, ctx *runtime.Context) (interface{}, error) {
  return "Hello, World!", nil
}

func init() {
  runtime.HandleFunc(handle)
}

func main() {}
docker pull eawsy/aws-lambda-go
docker run --rm -v $GOPATH:/go -v $PWD:/tmp eawsy/aws-lambda-go
aws lambda create-function \
  --function-name preview-go \
  --runtime python2.7 --handler handler.handle --zip-file fileb://handler.zip \
  --role arn:aws:iam::AWS_ACCOUNT_NUMBER:role/lambda_basic_execution

aws lambda invoke --function-name preview-go output.txt

Preview

Support

  • Contact us and community members through various channels.
  • Hire us to help you build modern applications on AWS.

Welcome

[Getting Started](Getting Started)

  • [Create](Getting Started#create-a-hello-world-lambda-function)
  • [Invoke](Getting Started#invoke-the-lambda-function-manually)
  • [Verify](Getting Started#verify-execution-results-and-logs)

[Programming Model](Programming Model)

  • [Handler](Programming Model#handler)
  • [Context](Programming Model#context)
  • [Logging](Programming Model#logging)
  • [Errors](Programming Model#errors)

[Deployment Package](Deployment Package)

  • [Project](Deployment Package#project)
  • [Package](Deployment Package#package)

Contact

Clone this wiki locally