Sparta shield

A go framework for AWS Lambda

Hello World


// File: application.go
package main

import (
  sparta ""

// Hello world event handler
func helloWorld() (string, error) {
	return "Hello World 🌏", nil

// Main
func main() {
  var lambdaFunctions []*sparta.LambdaAWSInfo
  lambdaFn := sparta.HandleAWSLambda("Hello world test",
  lambdaFunctions = append(lambdaFunctions, lambdaFn)

  // Delegate to Sparta
		"Simple Sparta application that creates a single AWS Lambda function",


$ go run main.go provision --s3Bucket MY_S3_BUCKET

Sparta Features

Unified Language

Use a single go codebase to define your microservice's:

  • Application logic
  • AWS infrastructure
  • Operational metrics
  • Alert conditions
  • Security policies

Complete AWS Ecosystem

Sparta enables your lambda-based service to seamlessly integrate with the entire set of AWS lambda event sources such as:

  • DynamoDB
  • S3
  • Kinesis
  • SNS
  • SES
  • CloudWatch Events
  • CloudWatch Logs
Additionally, your service may provision any other CloudFormation supported resource and even your own CustomResources.


Define IAM Roles with limited privileges to minimize your service's attack surface. Both string literal and ARN expressions are supported in order to reference dynamically created resources. Sparta treats POLP and #SecOps as first-class goals.


A service may provision dynamic AWS infrastructure, and discover, at lambda execution time, the dependent resources' AWS-assigned outputs (Ref & Fn::Att). Eliminate hardcoded Magic ARNs from your codebase and move towards immutable infrastructure

API Gateway

Make your service HTTPS accessible by binding it to an API Gateway REST API during provisioning. As part of API Gateway creation, Sparta includes API Gateway Mapping Templates with all request data, including user-defined whitelisted parameters, so that you can focus on your core application logic.

Static Sites

Include a CORS-enabled S3-backed site with your service. S3-backed sites include API Gateway discovery information for turnkey deployment.

Sparta Overview

Sparta exclusively relies on CloudFormation to deploy and update your application. For resources that CloudFormation does not yet support, it uses Lambda-backed Custom Resources so that all service updates support both update and rollback semantics. Sparta’s automatically generated CloudFormation resources use content-based logical IDs whenever possible to preserve service availability during updates.

Getting Started

To get started using Sparta, begin with the Overview.


Eveyone Welcome

Courtesy of gophers


Get in touch via:

Other resources