2014-07-25 18:53:06 +02:00
|
|
|
---
|
|
|
|
layout: "intro"
|
|
|
|
page_title: "Terraform vs. CloudFormation, Heat, etc."
|
|
|
|
sidebar_current: "vs-other-cloudformation"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
2021-06-28 23:06:50 +02:00
|
|
|
How Terraform compares to other infrastructure as code tools.
|
2014-07-25 18:53:06 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# Terraform vs. CloudFormation, Heat, etc.
|
|
|
|
|
2014-09-02 20:29:22 +02:00
|
|
|
Tools like CloudFormation, Heat, etc. allow the details of an infrastructure
|
2014-07-25 18:53:06 +02:00
|
|
|
to be codified into a configuration file. The configuration files allow
|
|
|
|
the infrastructure to be elastically created, modified and destroyed. Terraform
|
|
|
|
is inspired by the problems they solve.
|
|
|
|
|
|
|
|
Terraform similarly uses configuration files to detail the infrastructure
|
2014-09-02 20:29:22 +02:00
|
|
|
setup, but it goes further by being both cloud-agnostic and enabling
|
2014-07-25 18:53:06 +02:00
|
|
|
multiple providers and services to be combined and composed. For example,
|
|
|
|
Terraform can be used to orchestrate an AWS and OpenStack cluster simultaneously,
|
2017-03-18 13:34:07 +01:00
|
|
|
while enabling 3rd-party providers like Cloudflare and DNSimple to be integrated
|
2014-07-25 18:53:06 +02:00
|
|
|
to provide CDN and DNS services. This enables Terraform to represent and
|
2014-07-28 22:09:32 +02:00
|
|
|
manage the entire infrastructure with its supporting services, instead of
|
2014-07-25 18:53:06 +02:00
|
|
|
only the subset that exists within a single provider. It provides a single
|
|
|
|
unified syntax, instead of requiring operators to use independent and
|
|
|
|
non-interoperable tools for each platform and service.
|
|
|
|
|
2014-07-29 08:51:24 +02:00
|
|
|
Terraform also separates the planning phase from the execution phase,
|
2014-07-25 18:53:06 +02:00
|
|
|
by using the concept of an execution plan. By running `terraform plan`,
|
|
|
|
the current state is refreshed and the configuration is consulted to
|
|
|
|
generate an action plan. The plan includes all actions to be taken:
|
|
|
|
which resources will be created, destroyed or modified. It can be
|
|
|
|
inspected by operators to ensure it is exactly what is expected. Using
|
|
|
|
`terraform graph`, the plan can be visualized to show dependent ordering.
|
|
|
|
Once the plan is captured, the execution phase can be limited to only
|
|
|
|
the actions in the plan. Other tools combine the planning and execution
|
|
|
|
phases, meaning operators are forced to mentally reason about the effects
|
|
|
|
of a change, which quickly becomes intractable in large infrastructures.
|
|
|
|
Terraform lets operators apply changes with confidence, as they know exactly
|
2014-09-02 20:29:22 +02:00
|
|
|
what will happen beforehand.
|