liveBook · Manning

Terraform

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

Terraform is an open-source infrastructure-as-code tool for defining and provisioning infrastructure through declarative configuration files.

Terraform is an open-source infrastructure-as-code tool developed by HashiCorp. It primarily provisions new infrastructure—such as servers, databases, networks, and cloud resources—rather than managing configurations on existing devices. section 25.2.2 section 25.0

Terraform uses a declarative model: configuration files describe the desired end state instead of prescribing step-by-step procedures. Terraform Core compares that desired state with the Terraform state file, then works through providers to reconcile infrastructure. section 25.2.2 section 25.3

Use the basic Terraform workflow in three stages:

  • Write: define desired infrastructure resources in HCL configuration files. section 25.2.2
  • Plan: inspect and verify the changes Terraform intends to execute. section 25.2.2
  • Apply: execute the plan to provision and manage resources according to the configuration. section 25.2.2
  • Classify Terraform as declarative, agentless, and push-based; its configuration language is HCL and its implementation language is Go. section 25.2 section 25.3

Terraform and Ansible can complement each other: Terraform provisions infrastructure, while Ansible primarily manages the configuration of infrastructure that already exists. Both tools can perform both roles, but their typical strengths differ. section 25.2.2

Figure 25.6 Provisioning resources with Terraform. Configuration files are processed byTerraform Core to interact with various providers (i.e., public cloud providers) and manage infrastructure resources while maintaining state information in the state file.
A diagram of a software process Description automatically generated

Trace how HCL configuration reaches providers through Terraform Core while infrastructure state is maintained in the state file. section 25.2.2

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Explains classification, architecture, state comparison, providers, and the Write–Plan–Apply workflow, without detailed provider configuration.
Examples
Uses servers, databases, networks, cloud providers, HCL files, plans, applies, and Terraform state as concrete artifacts.
What it assumes
Assumes familiarity with infrastructure and configuration management while defining declarative state and Terraform terminology.
What you can do after
Operate/configure Terraform by defining infrastructure, reviewing a plan, applying changes, and distinguishing provisioning from configuration management.
How it connects
Connects infrastructure as code, declarative configuration, HCL, Terraform Core, state files, providers, and Ansible.

Also explained in

Compare how 5 books explain Terraform →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.