Deploy Golang Lambda with AWS Serverless Application Model

Amazon just recently announced native Golang support for AWS Lambda. Together with the Serverless Application Model (SAM) you can easily deploy your Golang code and create an HTTP interface using Amazon API Gateway.

I created an example project on GitHub with multiple binaries that are deployed using CircleCI and the AWS Command-Line interface. Thanks to the Serverless Application Model the needed CloudFormation template is minimal, compared to creating all resources individually:

AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Resources:
  People:
    Type: AWS::Serverless::Function
    Properties:
      Handler: dist/handler/people
      Runtime: go1.x
      Tracing: Active
      Events:
        GetEvent:
          Type: Api
          Properties:
            Path: /people
            Method: get

You can easily notice, the Serverless Application Model is heavily influenced by the serverless project. Together with improved AWS performance, using Golang, AWS Lambda, and SAM seem to create a perfect setup to deploy serverless applications.


View on GitHub Source code is published using the MIT license.