StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. DevOps
  3. Continuous Deployment
  4. Server Configuration And Automation
  5. Serverless vs Terraform

Serverless vs Terraform

OverviewDecisionsComparisonAlternatives

Overview

Terraform
Terraform
Stacks22.9K
Followers14.7K
Votes344
GitHub Stars47.0K
Forks10.1K
Serverless
Serverless
Stacks2.2K
Followers1.2K
Votes28
GitHub Stars46.9K
Forks5.7K

Serverless vs Terraform: What are the differences?

Serverless and Terraform are two popular technologies used in web development and infrastructure management. While both have their own unique features and functionalities, they also have some key differences that set them apart from each other. This markdown code aims to highlight and provide a concise description of these differences.

  1. Scalability: Serverless architecture allows applications to automatically scale up or down based on demand. It abstracts the infrastructure layer and manages the scaling on behalf of the developers. On the other hand, Terraform is an infrastructure-as-code tool that provides scalability through defining resources and their configurations in the code. It allows developers to specify the desired state of their infrastructure and make changes accordingly.

  2. Vendor Lock-In: Serverless platforms are often tied to a specific cloud provider, such as AWS Lambda or Azure Functions. This can result in vendor lock-in, making it difficult to switch to another provider. Terraform, on the other hand, is cloud-agnostic and supports multiple cloud providers. It allows developers to define resources using a consistent language across different platforms, reducing vendor dependency.

  3. Cost Management: Serverless architectures have a pay-per-use pricing model, where developers are charged based on the actual usage of their applications. This can be advantageous for applications with unpredictable or varying workloads. Terraform, on the other hand, does not directly handle cost management. It focuses on infrastructure provisioning and management, and developers need to manage the cost of resources manually.

  4. Flexibility: Serverless architectures provide a high level of flexibility, allowing developers to focus on writing code without worrying about infrastructure management. It abstracts away infrastructure details, making it easier to deploy and maintain applications. Terraform, on the other hand, offers more control and flexibility in defining infrastructure configurations. Developers can specify resource parameters and dependencies, giving them granular control over their infrastructure.

  5. Execution Environment: Serverless platforms provide isolated execution environments for applications, ensuring that one application does not impact the performance or security of other applications. Terraform, on the other hand, does not provide execution environments as it focuses on provisioning and managing infrastructure. It is mainly used in conjunction with other tools and platforms to run applications.

  6. Deployment Time: Serverless architectures offer faster deployment times as the infrastructure is managed by the platform. Developers can quickly deploy their applications without worrying about configuring servers or managing infrastructure. Terraform, on the other hand, may have longer deployment times, especially for larger infrastructures. It requires the creation and configuration of resources, which can take more time depending on the complexity of the infrastructure.

In summary, Serverless architecture provides automatic scaling, vendor lock-in, cost management, flexibility, isolated execution environments, and faster deployment times, while Terraform focuses on cloud-agnostic infrastructure provisioning, offers more control and flexibility, does not handle cost management directly, does not provide execution environments, and may have longer deployment times.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Advice on Terraform, Serverless

Sung Won
Sung Won

Nov 4, 2019

DecidedonGoogle Cloud IoT CoreGoogle Cloud IoT CoreTerraformTerraformPythonPython

Context: I wanted to create an end to end IoT data pipeline simulation in Google Cloud IoT Core and other GCP services. I never touched Terraform meaningfully until working on this project, and it's one of the best explorations in my development career. The documentation and syntax is incredibly human-readable and friendly. I'm used to building infrastructure through the google apis via Python , but I'm so glad past Sung did not make that decision. I was tempted to use Google Cloud Deployment Manager, but the templates were a bit convoluted by first impression. I'm glad past Sung did not make this decision either.

Solution: Leveraging Google Cloud Build Google Cloud Run Google Cloud Bigtable Google BigQuery Google Cloud Storage Google Compute Engine along with some other fun tools, I can deploy over 40 GCP resources using Terraform!

Check Out My Architecture: CLICK ME

Check out the GitHub repo attached

2.25M views2.25M
Comments
Praveen
Praveen

Engineering Manager at Taylor and Francis

Jul 29, 2019

Needs adviceonMongoDB AtlasMongoDB AtlasJavaJavaSpring BootSpring Boot

We are in the process of building a modern content platform to deliver our content through various channels. We decided to go with Microservices architecture as we wanted scale. Microservice architecture style is an approach to developing an application as a suite of small independently deployable services built around specific business capabilities. You can gain modularity, extensive parallelism and cost-effective scaling by deploying services across many distributed servers. Microservices modularity facilitates independent updates/deployments, and helps to avoid single point of failure, which can help prevent large-scale outages. We also decided to use Event Driven Architecture pattern which is a popular distributed asynchronous architecture pattern used to produce highly scalable applications. The event-driven architecture is made up of highly decoupled, single-purpose event processing components that asynchronously receive and process events.

To build our #Backend capabilities we decided to use the following:

  1. @{#Microservices}|topic:513| - @{Java}|tool:995| with @{Spring Boot}|tool:2927| , @{Node.js}|tool:1011| with @{ExpressJS}|tool:1163| and @{Python}|tool:993| with @{Flask}|tool:1001|
  2. @{#Eventsourcingframework}|topic:890| - @{Amazon Kinesis}|tool:433| , @{Amazon Kinesis Firehose}|tool:3770| , @{Amazon SNS}|tool:396| , @{Amazon SQS}|tool:395|, @{AWS Lambda}|tool:1909|
  3. @{#Data}|topic:1360| - @{Amazon RDS}|tool:232| , @{Amazon DynamoDB}|tool:389| , @{Amazon S3}|tool:25| , @{MongoDB Atlas}|tool:5739|

To build #Webapps we decided to use Angular with RxJS

#Devops - GitHub , Travis CI , Terraform , Docker , Serverless

4.12M views4.12M
Comments
Tim
Tim

CTO at Checkly Inc.

Sep 18, 2019

Needs adviceonHerokuHerokuAWS LambdaAWS Lambda

When adding a new feature to Checkly rearchitecting some older piece, I tend to pick Heroku for rolling it out. But not always, because sometimes I pick AWS Lambda . The short story:

  • Developer Experience trumps everything.
  • AWS Lambda is cheap. Up to a limit though. This impact not only your wallet.
  • If you need geographic spread, AWS is lonely at the top.

The setup

Recently, I was doing a brainstorm at a startup here in Berlin on the future of their infrastructure. They were ready to move on from their initial, almost 100% Ec2 + Chef based setup. Everything was on the table. But we crossed out a lot quite quickly:

  • Pure, uncut, self hosted Kubernetes — way too much complexity
  • Managed Kubernetes in various flavors — still too much complexity
  • Zeit — Maybe, but no Docker support
  • Elastic Beanstalk — Maybe, bit old but does the job
  • Heroku
  • Lambda

It became clear a mix of PaaS and FaaS was the way to go. What a surprise! That is exactly what I use for Checkly! But when do you pick which model?

I chopped that question up into the following categories:

  • Developer Experience / DX 🤓
  • Ops Experience / OX 🐂 (?)
  • Cost 💵
  • Lock in 🔐

Read the full post linked below for all details

357k views357k
Comments

Detailed Comparison

Terraform
Terraform
Serverless
Serverless

With Terraform, you describe your complete infrastructure as code, even as it spans multiple service providers. Your servers may come from AWS, your DNS may come from CloudFlare, and your database may come from Heroku. Terraform will build all these resources across all these providers in parallel.

Build applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. This lowers the total cost of maintaining your apps, enabling you to build more logic, faster. The Framework uses new event-driven compute services, like AWS Lambda, Google CloudFunctions, and more.

Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.;Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.;Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.;Change Automation: Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors
-
Statistics
GitHub Stars
47.0K
GitHub Stars
46.9K
GitHub Forks
10.1K
GitHub Forks
5.7K
Stacks
22.9K
Stacks
2.2K
Followers
14.7K
Followers
1.2K
Votes
344
Votes
28
Pros & Cons
Pros
  • 121
    Infrastructure as code
  • 73
    Declarative syntax
  • 45
    Planning
  • 28
    Simple
  • 24
    Parallelism
Cons
  • 1
    Doesn't have full support to GKE
Pros
  • 14
    API integration
  • 7
    Supports cloud functions for Google, Azure, and IBM
  • 3
    Lower cost
  • 1
    5. Built-in Redundancy and Availability:
  • 1
    3. Simplified Management for developers to focus on cod
Integrations
Heroku
Heroku
Amazon EC2
Amazon EC2
CloudFlare
CloudFlare
DNSimple
DNSimple
Microsoft Azure
Microsoft Azure
Consul
Consul
Equinix Metal
Equinix Metal
DigitalOcean
DigitalOcean
OpenStack
OpenStack
Google Compute Engine
Google Compute Engine
Azure Functions
Azure Functions
AWS Lambda
AWS Lambda
Amazon API Gateway
Amazon API Gateway

What are some alternatives to Terraform, Serverless?

Ansible

Ansible

Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s goals are foremost those of simplicity and maximum ease of use.

AWS Lambda

AWS Lambda

AWS Lambda is a compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security.

Chef

Chef

Chef enables you to manage and scale cloud infrastructure with no downtime or interruptions. Freely move applications and configurations from one cloud to another. Chef is integrated with all major cloud providers including Amazon EC2, VMWare, IBM Smartcloud, Rackspace, OpenStack, Windows Azure, HP Cloud, Google Compute Engine, Joyent Cloud and others.

Capistrano

Capistrano

Capistrano is a remote server automation tool. It supports the scripting and execution of arbitrary tasks, and includes a set of sane-default deployment workflows.

Puppet Labs

Puppet Labs

Puppet is an automated administrative engine for your Linux, Unix, and Windows systems and performs administrative tasks (such as adding users, installing packages, and updating server configurations) based on a centralized specification.

Salt

Salt

Salt is a new approach to infrastructure management. Easy enough to get running in minutes, scalable enough to manage tens of thousands of servers, and fast enough to communicate with them in seconds. Salt delivers a dynamic communication bus for infrastructures that can be used for orchestration, remote execution, configuration management and much more.

Fabric

Fabric

Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.

Azure Functions

Azure Functions

Azure Functions is an event driven, compute-on-demand experience that extends the existing Azure application platform with capabilities to implement code triggered by events occurring in virtually any Azure or 3rd party service as well as on-premises systems.

Google Cloud Run

Google Cloud Run

A managed compute platform that enables you to run stateless containers that are invocable via HTTP requests. It's serverless by abstracting away all infrastructure management.

AWS OpsWorks

AWS OpsWorks

Start from templates for common technologies like Ruby, Node.JS, PHP, and Java, or build your own using Chef recipes to install software packages and perform any task that you can script. AWS OpsWorks can scale your application using automatic load-based or time-based scaling and maintain the health of your application by detecting failed instances and replacing them. You have full control of deployments and automation of each component

Related Comparisons

GitHub
Bitbucket

Bitbucket vs GitHub vs GitLab

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot