/Sparta

Run go functions in AWS Lambda

Primary LanguageJavaScriptMIT LicenseMIT

Sparta

Build Status GoDoc

Visit gosparta.io for complete documentation.

Overview

Sparta takes a set of golang functions and automatically provisions them in AWS Lambda as a logical unit.

Functions must implement

type LambdaFunction func(*json.RawMessage,
                          *LambdaContext,
                          http.ResponseWriter,
                          *logrus.Logger)

where

  • json.RawMessage : The arbitrary json.RawMessage event data provided to the function.
  • LambdaContext : golang compatible representation of the AWS Lambda Context
  • http.ResponseWriter : Writer for response. The HTTP status code & response body is translated to a pass/fail result provided to the context.done() handler.
  • logrus.Logger : logrus logger with JSON output. See an example for including JSON fields.

Given a set of registered golang functions, Sparta will:

  • Either verify or provision the defined IAM roles
  • Build a deployable application via Provision()
  • Zip the contents and associated JS proxying logic
  • Dynamically create a CloudFormation template to either create or update the service state.
  • Optionally:
    • Register with S3 and SNS for push source configuration
    • Provision an API Gateway service to make your functions publicly available
    • Provision an S3 static website

Note that Lambda updates may be performed with no interruption in service.

Visit gosparta.io for complete documentation.

Limitations

See the Limitations page for the most up-to-date information.

Contributors

Thanks to all Sparta contributors (alphabetical)