-
Notifications
You must be signed in to change notification settings - Fork 36
Home
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.
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.
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.
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
- Contact us and community members through various channels.
- Hire us to help you build modern applications on AWS.
Copyright 2016 Alsanium, SAS. or its affiliates. All rights reserved.
Source code licensed under the Apache License, Version 2.0.
Documentation licensed under the Creative Commons Attribution 4.0 International Public License.
[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)