Skip to main content

Deploy Buz to AWS Lambda using Terraform

Estimated time: 3 minutes


The easiest and most cost-effective way to deploy Buz on AWS is via Lambda.

The following is a guide to doing so with Terraform. It sets up the following resources:

  • Lambda function for running serverless Buz
  • Cloudfront distribution for mapping lambda to a pretty DNS name
  • S3 buckets for schemas and events
  • ECR repository for hosting Buz artifacts
  • Kinesis Firehose delivery streams for dynamically-partitioning events to S3

The deployment also sets up the appropriate IAM config.

Local Prerequisites

You will need the following locally to terraform Buz:

AWS Prerequisites

You will need the following AWS resources:


1. Clone Buz and navigate to the AWS Lambda deployment dir

git clone && cd buz/deploy/terraform/aws/lambda/

2. Authenticate the Docker cli to your default registry

aws ecr get-login-password --region region | docker login --username AWS --password-stdin

(More info can be found here:

3. Create and Populate a tfvars file

touch terraform.tfvars

Sample Contents:

system = "buz"
env = "prod"
buz_domain = ""
events_bucket_name = "events"
schema_bucket_name = "schemas"
certificate_arn = "arn:aws:acm:your_certificate_arn"

4. Initialize and Apply

terraform init && terraform apply

If all goes well the terraform output will be something like the following:

buz_cloudfront_url = ""
buz_function_url = ""
buz_version = "v0.12.8"
events_bucket = "buz-dev-events"
invalid_stream = "buz-dev-invalid"
schema_bucket = "buz-dev-schemas"
valid_stream = "buz-dev-valid"

5. Profit