go microservices, powered by AWS Lambda
Go JavaScript Other
Latest commit 2231370 Aug 11, 2018
Permalink
Failed to load latest commit information.
aws Function comment Aug 11, 2018
cmd/insertTags Patch up new GoAST scanner false positives Mar 22, 2018
decorator Add LogAggregatorDecorator Aug 8, 2018
docker Migrate to pkg/errors Feb 4, 2018
resources Update template for cytoscape visualization Jul 1, 2018
site Bump image to match new layout Jun 6, 2018
zip Patch up new GoAST scanner false positives Mar 22, 2018
.gitignore Ignore vendor Feb 28, 2018
.travis.yml Bump to Go 1.10 Feb 24, 2018
CHANGES.md Additional CHANGES for 1.2.1 Aug 12, 2018
CONSTANTS.go Autogenerated update Jul 1, 2018
CONSTANTS_AWSBINARY.go Enable gas (https://github.com/GoASTScanner/gas) & fix all errors Feb 27, 2018
Gopkg.lock Bump dependencies Aug 9, 2018
Gopkg.toml Bump dependencies Aug 9, 2018
LICENSE.txt Update dates Aug 21, 2016
Makefile Exclude false positive gosec results Aug 11, 2018
README.md Update README for 1.0 Feb 9, 2018
apigateway.go Expose `api.LogicalResourceName()` to get RestAPI Feb 13, 2018
buildinfo.go Tagging Sparta commit Aug 12, 2018
buildinfo.sh Add timestamp to build info Jan 16, 2018
cloudformation_resources.go Prefer go-cloudcondenser.SafeMerge() Feb 9, 2018
context.go Define new context keys Jan 14, 2018
data_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
delete.go Update logrus imports Jan 14, 2018
describe.go github.com/securego/gosec fixes Aug 9, 2018
describe_test.go Use proper error formatter Dec 29, 2017
discovery.go Update logrus imports Jan 14, 2018
discovery_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc.go Stylistic changes Dec 29, 2017
doc_cloudwatchevents_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_cloudwatchlogs_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_newlambda1_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_newlambda2_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_newmain_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_newmaingateway_http_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_newmaingateway_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_newmains3site_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_parseoptions_test.go Migrate to pkg/errors Feb 4, 2018
doc_s3permission_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_sespermission_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_snspermission_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
doc_usercustomresource_test.go Update CustomResource function signatures Jan 30, 2018
doc_workflowhooks_test.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
execute.go Migrate to pkg/errors Feb 4, 2018
execute_awsbinary.go Log sysinfo at startup Aug 11, 2018
execute_build.go Define StampedBuildID global var to expose build id May 15, 2018
explore.go github.com/securego/gosec fixes Aug 9, 2018
explore_views.go github.com/securego/gosec fixes Aug 9, 2018
generate-constants.sh Remove legacy proxying requirements Jan 14, 2018
hooks.go Include RuntimeLoggerHook typedef Aug 8, 2018
lambda_permissions.go Add support for per S3 bucket filters in describe Jul 1, 2018
profile.go Update logrus imports Jan 14, 2018
profile_loop_awsbinary.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
profile_loop_build.go Patch up new GoAST scanner false positives Mar 22, 2018
provision.go Formatting change only Aug 8, 2018
provision_annotations.go Simplify EventSourceMapping visitor Jul 1, 2018
provision_build.go Use proper error string for provision failures Jun 29, 2018
provision_custom_resources.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
provision_test.go Migrate to pkg/errors Feb 4, 2018
resource_references.go Simplify EventSourceMapping visitor Jul 1, 2018
s3site.go Interrelated: Jan 21, 2018
s3site_awsbinary.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018
s3site_build.go Ensure S3site directory exists at build time Jun 28, 2018
sparta.go Support logrus hooks Aug 8, 2018
sparta_main.go github.com/securego/gosec fixes Aug 9, 2018
sparta_main_awsbinary.go Support logrus hooks Aug 8, 2018
sparta_main_build.go Support logrus hooks Aug 8, 2018
sparta_test.go Additional test Mar 22, 2018
util.go Formatting tweak Feb 28, 2018
versioning.go Reimplement binding, dispatch logic for 1.0 release Jan 14, 2018

README.md

Sparta

Build Status

GoDoc

Go Report Card

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.

AWS Lambda functions are defined using the standard AWS Lambda signatures:

  • func()
  • func() error
  • func(TIn) error
  • func() (TOut, error)
  • func(context.Context) error
  • func(context.Context, TIn) error
  • func(context.Context) (TOut, error)
  • func(context.Context, TIn) (TOut, error)

The TIn and TOut parameters represent encoding/json un/marshallable types.

For instance:

// Standard AWS λ function
func helloWorld(ctx context.Context) (string, error) {
  ...
}

where

  • ctx : The request context that includes Sparta both the AWS Context as well as Sparta specific values

Consumers define a set of lambda functions and provide them to Sparta to create a self-documenting, self-deploying AWS Lambda binary:

	lambdaFn := sparta.HandleAWSLambda("Hello World",
		helloWorld,
		sparta.IAMRoleDefinition{})

	var lambdaFunctions []*sparta.LambdaAWSInfo
	lambdaFunctions = append(lambdaFunctions, lambdaFn)

	err := sparta.Main("HelloWorldStack",
		"My Hello World stack",
		lambdaFunctions,
		nil,
		nil)

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 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

Visit gosparta.io for complete documentation.

Contributors

Thanks to all Sparta contributors (alphabetical)