Awesome Open Source
Awesome Open Source

Powered by Amazon Web Services Created by eawsy


Amazon API Gateway proxy for AWS Lambda Go runtime.

Api Status License Help Social

AWS Lambda lets you run code without provisioning or managing servers. With eawsy/aws-lambda-go-shim, you can author your Lambda function code in Go. This project provides a seamless proxy layer which translates Amazon API Gateway requests to Go HTTP requests. It allows you for example to port your existing Go HTTP applications to Amazon API Gateway & AWS Lambda, without modification.

Quick Hands-On

For step by step instructions on how to author your AWS Lambda function code in Go, see eawsy/aws-lambda-go-shim. Vanilla Go net/http package is used for the sake of simplicity. You are free to use your favorite Go Web framework.


go get -u -d


package main

import (


// Handle is the exported handler called by AWS Lambda.
var Handle apigatewayproxy.Handler

func init() {
	ln := net.Listen()

	// Amazon API Gateway binary media types are supported out of the box.
	// If you don't send or receive binary data, you can safely set it to nil.
	Handle = apigatewayproxy.New(ln, []string{"image/png"}).Handle

	// Any Go framework complying with the Go http.Handler interface can be used.
	// This includes, but is not limited to, Vanilla Go, Gin, Echo, Gorrila, Goa, etc.
	go http.Serve(ln, http.HandlerFunc(handle))

func handle(w http.ResponseWriter, r *http.Request) {
	w.Write([]byte("Hello, World!"))


For step by step instructions on how to author your AWS Lambda function code in Go, see eawsy/aws-lambda-go-shim.



AWS Serverless Application Model (SAM) is used for the sake of simplicity. You are free to use your favorite deployment tool.

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
    Type: AWS::Serverless::Function
      Handler: handler.Handle
      Runtime: python2.7
      CodeUri: ./
          Type: Api
            Path: /
            Method: ANY
          Type: Api
            Path: /{proxy+}
            Method: ANY
    Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}"
aws cloudformation package \
  --template-file example.sam.yaml \
  --output-template-file example.out.yaml \
  --s3-bucket <YOUR BUCKET NAME>

aws cloudformation deploy \
  --template-file example.out.yaml \
  --capabilities CAPABILITY_IAM \
  --stack-name <YOUR STACK NAME>


aws cloudformation describe-stacks \
  --stack-name <YOUR STACK NAME> \
  --query Stacks[0].Outputs[0]

# "https://<YOUR API URL>/"

curl https://<YOUR API URL>/

# Hello, World!

If you want to execute your AWS Lambda function from the AWS Lambda console, please pay attention to the provided test event. This project is intended to run seamlessly behind an Amazon API Gateway Proxy.



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.


We want to make it easy for you, users and contributers, to talk with us and connect with each others, to share ideas, solve problems and make help this project awesome. Here are the main channels we're running currently and we'd love to hear from you on them.



Follow and chat with us on Twitter.

Share stories!



This is for all of you. Users, developers and curious. You can find help, links, questions and answers from all the community including the core team.

Ask questions!


pull requests & issues

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through the eawsy/bavardage channel, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

Write code!


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.


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, Inc. or its affiliates in the United States and/or other countries.

Alternatives To Archive_aws Lambda Go Net
Select To Compare

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Golang (172,254
Go (172,254
Server (65,687
Aws (39,294
Http (30,287
Lambda (13,992
Amazon (11,038
Serverless (10,214
Aws Lambda (3,631
Api Gateway (2,062
Aws Apigateway (218