Run go functions in AWS Lambda
JavaScript Go Other
Permalink
Failed to load latest commit information.
Godeps Force ref to include in /vendor Jan 22, 2017
aws Moved to example app Dec 12, 2016
docker Initial commit of Sparta/docker Aug 19, 2016
explore mockAPIGatewayRequest to match APIGatewayLambdaJSONEvent. Nov 24, 2016
resources Update graph direction, nav header Sep 17, 2016
site Remove obsolete files Feb 16, 2016
zip Fix latent Zip writer close Oct 7, 2016
.gitignore Include /vendor for godep Jan 22, 2017
.jshintignore Initial commit Oct 26, 2015
.jshintrc Initial commit Oct 26, 2015
.travis.yml Bump AWS creds Jan 22, 2017
CHANGES.md Fix MD formatting Dec 12, 2016
CONSTANTS.go Autogenerated updates Dec 11, 2016
CONSTANTS_AWSBINARY.go Autogenerated updates Dec 11, 2016
LICENSE.txt Update dates Aug 21, 2016
Makefile Attempt godep restore given ./vendor removal Jan 26, 2017
README.md Add SourceGraph badge to README Feb 14, 2017
apigateway.go Ensure user Parameters are included in CF template Dec 12, 2016
cloudformation_resources.go Ensure user-decorated `Mappings` are copied to target template Aug 19, 2016
data_test.go BREAKING CHANGE Jan 18, 2016
delete.go Delegate to new cf/util.go functions Oct 7, 2016
describe.go Interrelated: Dec 11, 2016
describe_test.go Interrelated: Dec 11, 2016
discovery.go Support user-defined Sparta function names Oct 16, 2016
discovery_test.go Upgrade to type safe DiscoveryInfo struct for `sparta.Discovery()` Feb 5, 2016
doc.go Remove obsolete node_modules.zip building phase Sep 3, 2016
doc_cloudwatchevents_test.go Interrelated: Feb 16, 2016
doc_cloudwatchlogs_test.go Correct tests for 0.5.0 Feb 20, 2016
doc_newlambda1_test.go Support user-defined Sparta function names Oct 16, 2016
doc_newlambda2_test.go Change LambdaFunction signature to use non-pointer interface Nov 26, 2015
doc_newmain_test.go Update `sparta.Main` signature to match 0.1.0 update. Dec 15, 2015
doc_newmaingateway_http_test.go Update tests for 0.9.0 Aug 31, 2016
doc_newmaingateway_test.go Update tests for 0.9.0 Aug 31, 2016
doc_newmains3site_test.go Update tests for 0.9.0 Aug 31, 2016
doc_parseoptions_test.go Add ParseOptions godoc example Jun 12, 2016
doc_s3permission_test.go Update `sparta.Main` signature to match 0.1.0 update. Dec 15, 2015
doc_sespermission_test.go Add support for storing MessageBody as part of SESPermission Jan 15, 2016
doc_snspermission_test.go Update `sparta.Main` signature to match 0.1.0 update. Dec 15, 2015
doc_usercustomresource_test.go Add `buildID` to args Aug 21, 2016
doc_workflowhooks_test.go Correct WorkflowHook filename Aug 22, 2016
execute.go Ensure preconditions met, additional logging for CloudWatch debugging Jun 9, 2016
execute_utils.go Support user-defined Sparta function names Oct 16, 2016
explore.go Support user-defined Sparta function names Oct 16, 2016
explore_test.go mockAPIGatewayRequest to match APIGatewayLambdaJSONEvent. Nov 24, 2016
lambda_permissions.go Use stable & compliant rule name Dec 11, 2016
provision.go Ensure user Parameters are included in CF template Dec 12, 2016
provision_custom_resources.go Support user-defined CloudFormation CustomResource functions May 3, 2016
provision_test.go Interrelated: Dec 11, 2016
provision_utils.go Interrelated: Dec 11, 2016
s3site.go Interrelated: Jun 9, 2016
sparta.go Force ref to include in /vendor Jan 22, 2017
sparta_awsbinary.go Update AWS binary NOOP function signatures Dec 11, 2016
sparta_buildBinary.go Add RegisterCodePipelineEnvironment() Dec 11, 2016
sparta_main.go Add codePipelineTrigger command line option to provision Dec 11, 2016
sparta_test.go Use env var for S3 test bucket Dec 11, 2016
sparta_xplatbuild.go Do not reference `syscall.Kill` Jan 20, 2016

README.md

Sparta

Build Status GoDoc Sourcegraph

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)