Overview

Terraform is an infrastructure as code (IaC) tool that allows users to define and provision infrastructure using a declarative configuration language. Developed by HashiCorp, it was first released in 2014. The core function of Terraform is to manage external resources, such as public cloud services, private clouds, and software-as-a-service (SaaS) offerings, through a consistent workflow. Users write configurations that describe the desired state of their infrastructure, and Terraform then creates, updates, and deletes resources to match that state.

Terraform's primary strength lies in its ability to provision infrastructure across multiple cloud providers and services. It achieves this through a plugin-based architecture, utilizing "providers" that abstract the APIs of various platforms. This enables organizations to manage infrastructure on platforms like AWS, Google Cloud, Azure, and Docker from a single configuration set. This multi-cloud capability is beneficial for avoiding vendor lock-in and ensuring consistency in hybrid cloud environments.

The tool is designed for developers, DevOps engineers, and infrastructure teams seeking to automate infrastructure deployment and management. It supports use cases ranging from provisioning a single virtual machine to orchestrating complex, multi-tier applications across different regions. Terraform manages infrastructure state, which is a record of the resources it has created. This state file allows Terraform to understand what infrastructure already exists and how to modify it to achieve the desired configuration, preventing unintended changes and ensuring idempotence.

While the command-line interface (CLI) is the foundational component, HashiCorp also offers Terraform Cloud and Terraform Enterprise. These platforms extend the CLI's capabilities with features like remote state management, team collaboration, policy enforcement (Policy as Code), and cost optimization. Terraform Cloud offers a free tier for individual users and small teams, providing a centralized platform for managing Terraform runs.

Key features

  • Declarative Configuration: Define infrastructure using HashiCorp Configuration Language (HCL) or JSON to specify the desired end state, rather than a sequence of commands.
  • Provider Ecosystem: Extensive collection of providers for various cloud platforms (AWS, Azure, Google Cloud), SaaS services, and on-premises solutions, allowing management of diverse infrastructure from a single tool.
  • Multi-Cloud Support: Provision and manage infrastructure across different cloud providers simultaneously, facilitating hybrid and multi-cloud strategies.
  • State Management: Maintains a state file that maps real-world resources to your configuration, enabling Terraform to understand existing infrastructure and plan changes accurately.
  • Execution Plans: Before applying changes, Terraform generates an execution plan that shows exactly what actions it will take, allowing for review and approval.
  • Resource Graph: Builds a graph of all your resources, parallelizing resource creation and destruction where possible, and understanding dependencies.
  • Modularity: Supports modules for packaging and reusing common infrastructure configurations, promoting consistency and reducing boilerplate code.
  • Policy as Code: Integrate with Sentinel or Open Policy Agent (OPA) to enforce governance policies on infrastructure deployments, available in Terraform Cloud and Enterprise.

Pricing

Terraform Cloud offers various tiers, including a free option for individual use and small teams. Paid tiers are based on resource hours consumed, with custom pricing available for larger organizations.

Tier Key Features Pricing Model (as of 2026-05-27)
Terraform Cloud Free Up to 5 users, remote operations, private module registry, VCS integration, shared state, API-driven workflows. Free
Terraform Cloud Standard Everything in Free, plus unlimited users, 500 resource hours/month included, cost estimation. $0.00014 per resource hour (after included hours)
Terraform Cloud Plus Everything in Standard, plus 2,500 resource hours/month included, run hours reporting, custom roles & permissions. $0.00021 per resource hour (after included hours)
Terraform Cloud Business & Premium Advanced governance, security, support, and private networking options. Custom enterprise pricing

For detailed and up-to-date pricing information, refer to the official Terraform pricing page.

Common integrations

  • Cloud Providers: Deep integration with major cloud platforms like AWS, Google Cloud Platform, and Azure for provisioning and managing resources.
  • Version Control Systems (VCS): Integrates with Git-based systems like GitHub, GitLab, and Bitbucket for storing configurations and triggering CI/CD pipelines (Terraform Cloud VCS integrations).
  • Configuration Management Tools: Can be used alongside tools like Ansible, Chef, or Puppet to further configure operating systems and deploy applications on infrastructure provisioned by Terraform.
  • Monitoring & Logging: Integrates with monitoring solutions like Grafana and logging platforms like Sumo Logic for observing infrastructure health and performance.
  • Container Orchestration: Provisions infrastructure for container orchestration platforms such as Kubernetes and Docker Swarm.
  • Security & Compliance: Works with tools like HashiCorp Sentinel and Open Policy Agent to enforce policy as code and security best practices.

Alternatives

  • Pulumi: An infrastructure as code tool that allows users to define infrastructure using general-purpose programming languages like Python, JavaScript, TypeScript, Go, and C#.
  • AWS CloudFormation: Amazon's own infrastructure as code service for provisioning and managing AWS resources.
  • Azure Resource Manager: Microsoft Azure's deployment and management service, providing a management layer that enables you to create, update, and delete resources in your Azure subscription.
  • Ansible: A popular open-source automation engine for configuration management, application deployment, and task automation, often used for post-provisioning steps.
  • Chef / Puppet: Configuration management tools that manage the configuration of servers, often used in conjunction with IaC tools like Terraform to configure software on provisioned machines.

Getting started

To get started with Terraform, you typically define your infrastructure in a .tf file using HCL. The following example provisions a simple S3 bucket on AWS. Before running this, ensure you have the Terraform CLI installed and AWS credentials configured.

# main.tf

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

# Configure the AWS provider
provider "aws" {
  region = "us-east-1"
}

# Create an S3 bucket
resource "aws_s3_bucket" "example_bucket" {
  bucket = "my-unique-cloudpicker-test-bucket-12345"
  acl    = "private"

  tags = {
    Name        = "MyCloudpickerBucket"
    Environment = "Testing"
  }
}

# Output the S3 bucket name
output "bucket_name" {
  value = aws_s3_bucket.example_bucket.bucket
}

To deploy this infrastructure:

  1. Save the code above as main.tf in an empty directory.
  2. Open your terminal in that directory.
  3. Run terraform init to initialize the working directory and download the AWS provider.
  4. Run terraform plan to see an execution plan of what Terraform will do.
  5. Run terraform apply to execute the plan and create the S3 bucket. Type yes when prompted.
  6. After successful creation, run terraform destroy to remove the S3 bucket when it's no longer needed.