• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Architect

  • Network Automation
    • Network Automation Courses
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible Software?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Hosts File
    • Python Network Automation
      • Nornir
      • Python Network Automation Course
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox Training
      • Infrahub
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

Terraform Tutorial

Home » Network Automation » Terraform

Terraform Tutorial for Beginners

Terraform is an open-source infrastructure as code software tool created by Hashicorp. Used to define and provision infrastructure using a declaritive configuration language know as Hashicorp Configuration Language (HCL) or JSON – https://en.wikipedia.org/wiki/Terraform_(software)

Infrastructure as Code

Infrastructure as code is the concept of managing your infrastructure in a single file or files that define how you want your infrastructure to look like. i.e if you want to provision 50 servers in AWS with certain sizes and functions and different networking, firewalls and load balancers etc. You could go in to the AWS console and provision these one at a time by hand, or you could define everything in a single file which via Terraform (or another cloud provisioning tool) push these changes to AWS.

Having all the infrastructure defined in this one file means you can enforce state and ensure your infrastructure is always configured correctly.

This file or files can now be version controlled with something like Git so you can roll back any changes and you have full visibility of anything that is happening to your infrastructure.

This is the basic concept of Infrastructure as Code or IaC.

Terraform’s Purpose

Terraform is a multi platform tool that can take these files and make the connections to different infrastructure and push the changes requested or deletions.

It is mainly focused on cloud environments, but can also provision networking resources like Cisco ACI F5 load balancers or ASAv firewalls.

Check out my post – Terraform vs Ansible – a comparison which is commonly made

Terraform Providers

Terraform works on the concept of Providers.

A provider is code that understands how to interact with a certain infrastructure. i.e if you wanted to provision an EC2 resource in AWS you don’t need to know how to code the API to interact with the AWS console, you simply add the AWS provider into your file, Terraform downloads the correct code when you set everything up and then you just enter your access credentials.

A full list of Terraform providers can be found on the Registry.
https://registry.terraform.io/browse/providers

Terraform Resources

Resources are the most important part of the Terraform language, they describe each and every part of an infrastructure.

A resource block declares a resource with a local name.

In the example below the resource is aws_instance and the local name is web.

resource "aws_instance" "web" {
  ami           = "ami-a1b2c3d4"
  instance_type = "t2.micro"
}

Terraform Modules

Modules allow you to group multiple resources together.

So you can put multiple resources together and package them into a module and then call that module.

It’s the same concept as packages in Python.

Terraform Variables

Input variables allow you to feed in parameters to a Terraform module.

Terraform Workspaces

Workspaces function like separate working directories and a workspace contains everything Terraform needs to manage a collection of infrastructure.

Terraform Cloud manages infrastructure collections with workspaces instead of directories.

Terraform Enterprise

Enterprise is a self-hosted version of Terraform Cloud. It allows enterprises to run a private instance of the Terraform Cloud application.

The main benefit is security, audit logging and no resource limits

Terraform Certification

Once you have got the basics under your belt you might want to get HashiCorp certified to prove your knowledge of the product.

The Terraform Associate exam is the starting point: https://www.hashicorp.com/certification/terraform-associate

There are some great free learning resources here: https://www.hashicorp.com/certification/terraform-associate

If you just want to learn more about Terraform there are many tutorials here: https://learn.hashicorp.com/terraform

Terraform Books

One of the best books to learn Terraform is “Terraform up and running” by Yevgeniy Brikma, Second Edition published by Oreily

So get started and download Terraform and start your journey into Infrastructure as Code with Terraform!

Category: Terraform
ansible course for network engineers
Get Access to my Ansible Course NOW
Previous Post:Install AWX on Ubuntu
Next Post:Netmikopython logo

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Sidebar

Hi I'm Roger Perkin,
Based in the UK working as a Network Automation Architect, CCIE #50038
About Roger | Twitter | Linkedin

python course for network engineers

Topics

Network Automation
Ansible
Python for Network Automation
CCIE
Cisco ISE
F5 Certification
BGP
OSPF
Network Automation Conferences
auvik promo banner
Pluralsight Trial

Git for Network Engineers

Ansible vs Nornir

Start learning today with my Network Automation Courses

Master Ansible, Python, Git, Nornir, Jenkins and more..


Buy me a coffeeBuy me a coffee

ansible network automation course

Have you seen my YouTube Channel?

YouTube Subscribe

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Home

Blog

About

C

Python VENV Tutorial
Python for Network Engineers

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2025 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms