Terraform
An infrastructure-as-code tool from HashiCorp that creates and changes cloud resources such as servers, networks and databases from configuration files.
In more detail
Terraform compares the resources described in its files with what exists in your cloud account and makes the changes needed to match. It is the usual tool for provisioning, and configuration tools then set up the machines it created.
Examples
Terraform creates the hosts; Ansible configures them.In AWS: An infrastructure as code tool that creates, changes and deletes cloud resources from configuration files, showing a plan first.terraform init && terraform plan && terraform applyIn Terraform: Terraform is one compiled program that understands the HCL language, the dependency graph, state and the plan and apply workflow. Everything it knows about clouds and services comes from separately downloaded provider plugins. The core workflow is write, init, plan, apply and, when you are finished, destroy.Related terms
- provisioning — Creating the machines, disks and networks themselves, so that there is something to log into and configure.
- configuration management — Keeping the software, settings, files and services on your machines in a known, described state, and putting them back when they wander from it.
- cloud provider — A company, such as AWS, Microsoft Azure or Google Cloud, that rents out computers, storage and networks over the internet on demand.
- infrastructure as code — Describing servers, networks and other infrastructure in text files that a tool reads to create and change the real thing.
- Terraform state — Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.
- terraform plan — The command that compares configuration, state and reality and prints the actions needed to make them match, without changing anything.
- HCL — HashiCorp Configuration Language: the block-based configuration syntax of Terraform files, which end in .tf.
- provider — A plugin that teaches Terraform how to talk to one API, such as AWS or your local disk, and which resource types it offers.
- OpenTofu — The open source fork of Terraform, created in 2023 after the licence change and governed by a foundation rather than one company.
- HashiCorp — The software company that created Terraform, Vault and other infrastructure tools, and which IBM now owns.
Taught in
- What Configuration Management Is — Ansible Configuration Management at Scale
- Infrastructure As Code In The Pipeline — Microsoft Azure DevOps Engineer Expert (AZ-400) Exam Prep
- Seven Steps Called GitOps: The Declarative Principle — Certified GitOps Associate (CGOA) Exam Prep
- Two Clicks Nobody Wrote Down: Configuration And Infrastructure As Code — Certified GitOps Associate (CGOA) Exam Prep
- Related Practices Sprint: One Change, Five Practices — Certified GitOps Associate (CGOA) Exam Prep
- Metrics, Logs, and Alarms — Cloud Infrastructure & Hyperscaler Architecture
- Cost, Budgets, and Tagging — Cloud Infrastructure & Hyperscaler Architecture
- The Console versus the CLI — Cloud Infrastructure & Hyperscaler Architecture
- Infrastructure as Code (Handover to Terraform) — Cloud Infrastructure & Hyperscaler Architecture
- Shift-Left Security Principles & Automated Pipeline Gates — Cloud Security & DevSecOps Engineering
- Software Composition Analysis with Trivy — Cloud Security & DevSecOps Engineering
- Static IaC Scanning: Linting Terraform with Checkov — Cloud Security & DevSecOps Engineering
- Policy-as-Code Architecture: OPA & Rego Syntax — Cloud Security & DevSecOps Engineering
- Enforcing OPA Guardrails on Terraform Plan Payloads — Cloud Security & DevSecOps Engineering
- Continuous IaC Drift Detection & State Protection — Cloud Security & DevSecOps Engineering
- Cloud Security Posture Management & Remediation — Cloud Security & DevSecOps Engineering
- Tooling: Infrastructure As Code And AI Assistants — Google Cloud Associate Cloud Engineer Exam Prep
- What Go Is and Why It Matters — Concurrent Systems Programming with Go
- What Is Infrastructure As Code? — Infrastructure as Code with Terraform
- The Licence, OpenTofu And IBM — Infrastructure as Code with Terraform
- Installing Terraform And Meeting The CLI — Infrastructure as Code with Terraform
- Providers And The required_providers Block — Infrastructure as Code with Terraform
- Writing Your First Configuration In HCL — Infrastructure as Code with Terraform
- Initialising The Working Directory — Infrastructure as Code with Terraform
- Predicting Changes, Then Applying Them — Infrastructure as Code with Terraform
- Tearing It Down With Destroy — Infrastructure as Code with Terraform
- Parameterising With Input Variables — Infrastructure as Code with Terraform
- Return Values: Outputs And Locals — Infrastructure as Code with Terraform
- Functions And Expressions In HCL — Infrastructure as Code with Terraform
- Querying Existing Infrastructure With Data Sources — Infrastructure as Code with Terraform
- Why Modules: Composition Versus Monoliths — Infrastructure as Code with Terraform
- Writing A Custom Network Module — Infrastructure as Code with Terraform
- Calling Your Module And Passing Variables — Infrastructure as Code with Terraform
- The Terraform Registry And Public Modules — Infrastructure as Code with Terraform
- Versioning And Pinning Modules — Infrastructure as Code with Terraform
- Scaling Resources With Count — Infrastructure as Code with Terraform
- Iterating Over Maps With For Each — Infrastructure as Code with Terraform
- Explicit Dependencies With Depends On — Infrastructure as Code with Terraform
- Safe Changes With Lifecycle Rules — Infrastructure as Code with Terraform
- Provisioners: Why They Are A Last Resort — Infrastructure as Code with Terraform
- What State Really Is And Why It Is Needed — Infrastructure as Code with Terraform
- Simulating A Managed Database — Infrastructure as Code with Terraform
- Detecting And Fixing Configuration Drift — Infrastructure as Code with Terraform
- Importing Existing Resources — Infrastructure as Code with Terraform
- Forcing Replacement — Infrastructure as Code with Terraform
- The Problem With Local State — Infrastructure as Code with Terraform
- Configuring A Remote Backend — Infrastructure as Code with Terraform
- State Locking With Use Lockfile — Infrastructure as Code with Terraform
- Workspaces For Multiple Environments — Infrastructure as Code with Terraform
- Security: Secrets In State And Ephemeral Values — Infrastructure as Code with Terraform
- Running Terraform In CI — Infrastructure as Code with Terraform
- Native Testing With Tftest Files — Infrastructure as Code with Terraform
- Provider Mocking For Tests — Infrastructure as Code with Terraform
- Policy As Code With OPA — Infrastructure as Code with Terraform
- Releasing The Real Cloud Artifact — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- One Hour, No Weights Published — HashiCorp Terraform Associate (004) Exam Prep
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- Providers: How Terraform Reaches Every API — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Write, Plan, Apply, And What Init Prepares — HashiCorp Terraform Associate (004) Exam Prep
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- A New Depot By Friday: OpenTofu, Cloud-init, Pipelines And Kubernetes — CompTIA Linux+ (XK0-006) Exam Prep
References
Certification courses
- AZ-400 course and practice exam: Microsoft Azure DevOps Engineer Expert
- CGOA course and practice exam: Certified GitOps Associate
- Google Associate Cloud Engineer course and practice exam: Google Cloud certification
- Terraform Associate course and practice exam: HashiCorp Terraform Associate (004)
- CompTIA Linux+ course and practice exam: XK0-006