Doing serverless with Terraform

Serverless Application & Infrastructure Lifecycle Management using Terraform and friends!

Give a star on GitHub, and share!

What is is an opinionated open-source framework for developing, building, deploying, and securing serverless applications and infrastructures on AWS using Terraform.

It has started as an organic response to the accidental complexity of many existing tools used by serverless developers.

This is not an official AWS or HashiCorp product, and not to be confused with the Serverless Framework.

Using Terraform AWS modules
Simplifying serverless for all

Challenges with existing solutions

Most of the existing solutions require you to become a Serverless Superhero to get things done!

1. There are too many similar tools

Developers and DevOps/Cloud engineers have to deal with several types of tools:

  1. Serverless application frameworks (Serverless Framework, AWS Chalice, Zappa)
  2. Infrastructure management (Terraform, AWS CloudFormation)
  3. Application deployment (Shell scripts, Makefile, AWS CodeDeploy, AWS CLI) approach:

Use Terraform (with or without Terragrunt) for comprehensive infrastructure management and serverless application deployments.

2. Different infrastructure resource scopes

Developers and DevOps/Cloud engineers manage different infrastructure services differently (for various reasons).

For example, serverless resources (API Gateways, AWS Lambda functions) are managed as part of the application framework, and traditional resources (VPC, IAM roles, S3 buckets) - using infrastructure management tools. approach:

Use a single tool that was created to manage infrastructure as code – Terraform – for all of your infrastructure resources.

3. Rather slow application development lifecycle

Developers like to have control of their environment as code. They also prefer running integration tests often before lengthy deployment cycles kick off. approach:

Have all infrastructure resources described as configuration files. This allows developers to spin up and tear down complete environments required for their work easily.

Having interaction with real services is often slower than running everything locally (eg, using localstack) but interaction with real services gives the most accurate feedback regarding how AWS services work.

4. Lack of high-quality reusable components

Some of the existing solutions support plugins that extend the functionality of the framework and to simplify the usage of infrastructure services.

In reality, often, developers still have to dive into those to learn internals and archive what they need. Adding functionality to those plugins usually requires writing Javascript code. approach:

By relying on open-source Terraform AWS modules that have been developed over the course of several years by Betajob in partnership with our huge community, you get to build your serverless project on top of verified, reusable components.

Please, contact Betajob if you want to sponsor the development of missing modules or features.


Why not just use the Serverless Framework?

The challenges listed above apply to the Serverless Framework, too. One of the biggest for us at Betajob was infrastructure fragmentation between CloudFormation and Terraform.

What is the supported workflow? does not restrict you from setting up your CI/CD workflow, which suits your needs, but it gives you the ways to control building, testing, deployments steps as code.

What runtimes are supported?

All of them. does not restrict you there, but it gives you a way to build, package, and deploy your code in a standardized way.

Who is developing and using this?

As far as we know, only we at Betajob are using framework, but Terraform AWS modules used by the framework are used by thousands of companies worldwide. We are going to continue developing Terraform modules we need for us and our clients.

What platforms are supported?

AWS only (for now).

Can I have commercial support for my Terraform and serverless project?

Yes, please reach out to Betajob.

What is the typical project for the approach?

We don't know this for sure yet, and we are going to find this out as more people use the framework and give feedback.

I want to use service X, but does not support it, what can I do?

We develop reusable solutions for our customers, or when we need them ourselves. Reach out to us if you want to discuss this or to sponsor the development of missing functionality.

Supported AWS Serverless Platform Services

See AWS Serverless official homepage for more information about each service, and Terraform AWS Modules for other compatible solutions.

AWS Lambda

AWS Lambda lets you run code without provisioning or managing servers.

Repository | Examples


Lambda@Edge allows you to run Lambda functions at AWS Edge locations in response to Amazon CloudFront events.

Repository | Examples

AWS AppSync

AWS AppSync simplifies application development by letting you create a flexible GraphQL API to securely access, manipulate, and combine data from one or more data sources.

Repository | Examples

Amazon EventBridge

Amazon EventBridge is a serverless event bus that makes it easier to build event-driven applications at scale using events generated from your applications, integrated SaaS applications, and AWS services.

Repository | Examples

AWS Step Functions

AWS Step Functions is a serverless function orchestrator that makes it easy to sequence AWS Lambda functions and multiple AWS services into business-critical applications.

Repository | Examples

Amazon CloudFront

Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment.

Repository | Examples

Amazon API Gateway - HTTP/WebSocket

Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

Repository | Examples

Amazon DynamoDB

Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale.

Repository | Examples

Amazon Aurora Serverless

Amazon Aurora Serverless is an on-demand, auto-scaling configuration for Amazon Aurora (MySQL-compatible edition), where the database will automatically start up, shut down, and scale capacity up or down based on your application's needs.

Repository | Examples

NEW!    Amazon RDS Proxy

Amazon RDS Proxy is a fully managed, highly available database proxy for Amazon Relational Database Service (RDS) that makes applications more scalable, more resilient to database failures, and more secure.

Repository | Examples

Amazon S3

Amazon Simple Storage Service (Amazon S3) provides developers and IT teams with secure, durable, highly-scalable object storage.

Repository | Examples

Amazon SNS

Amazon SNS is a fully managed pub/sub messaging service that makes it easy to decouple and scale microservices, distributed systems, and serverless applications.

Repository | Examples

Amazon CloudWatch

Amazon CloudWatch is a monitoring service for AWS cloud resources and the applications you run on AWS.

Repository | Examples

Amazon SQS

Amazon SQS is a fully managed message queuing service that makes it easy to decouple and scale microservices, distributed systems, and serverless applications.

Repository | Examples

AWS CodeDeploy

AWS CodeDeploy is a service that automates application deployments to a variety of compute services including Amazon EC2, AWS Lambda, and instances running on-premises.

Repository | Examples

NEW!    AWS AppConfig

AWS AppConfig, a capability of AWS Systems Manager, to create, manage, and quickly deploy application configurations.

Repository | Examples

Contact us

Got any questions? Or want to sponsor development? Don't hesitate to reach out.