Skip to content

dmreiland/Sparta

 
 

Repository files navigation

Build Status

GoDoc

Sparta

Documentation

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.

Outstanding

  • Eliminate NodeJS CustomResources
  • Support API Gateway updates
    • Currently API reprovisioning is done by delete => create
  • Implement APIGateway graph
  • Support APIGateway inline Model definition
  • Support custom domains

About

Run go functions in AWS Lambda

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 51.3%
  • JavaScript 48.3%
  • Other 0.4%