Skip to content

ando-masaki/aws-lambda-go

 
 

Repository files navigation

Powered by Amazon Web Services Created by eawsy

eawsy/aws-lambda-go

A fast and clean way to execute Go on AWS Lambda.

Runtime Api Chat Status License Hire us

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.

Preview

go get -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 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:https://handler.zip \
  --role arn:aws:iam::AWS_ACCOUNT_NUMBER:role/lambda_basic_execution

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

Preview

Documentation

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

About

eawsy

This project is maintained and funded by Alsanium, SAS.

We ❤️ AWS and open source software. See our other projects, or hire us to help you build modern applications on AWS.

License

This product is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this product except in compliance with the License. See LICENSE and NOTICE for more information.

Trademark

Alsanium, eawsy, the "Created by eawsy" logo, and the "eawsy" logo are trademarks of Alsanium, SAS. or its affiliates in France and/or other countries.

Amazon Web Services, the "Powered by Amazon Web Services" logo, and AWS Lambda are trademarks of Amazon.com, Inc. or its affiliates in the United States and/or other countries.

About

A fast and clean way to execute Go on AWS Lambda.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 67.9%
  • C 32.1%