About the course
Terraform by HashiCorp is the industry-leading open-source tool for building, changing, and versioning infrastructure safely and efficiently. By enabling Infrastructure as Code (IaC), Terraform allows organisations to manage their cloud and on-premises resources declaratively, predictably, and repeatedly. Moving beyond manual processes, IaC facilitates automation, improves consistency, and enhances collaboration across teams. This 3-day intensive hands-on training course provides a comprehensive deep dive into Terraform, taking participants from the core fundamentals right through to advanced topics, collaborative workflows, and essential real-world best practices needed to use Terraform effectively in production environments.
The course begins by introducing the concepts of Infrastructure as Code, the specific benefits and capabilities of Terraform, its architecture, installation, and the core command-line interface (CLI) workflow (init, plan, apply, destroy). Participants will master the HashiCorp Configuration Language (HCL), learning how to define infrastructure resources, use data sources to query existing infrastructure or external data, understand and configure providers for various platforms (including crucial authentication methods), and effectively use input/output variables, complex types, locals, expressions, and functions to build flexible and maintainable configurations. A significant focus is placed on understanding and implementing State Management, covering the state file structure, configuring and managing local and remote backends (with examples for popular clouds like AWS, Azure, GCP, and Terraform Cloud), implementing state locking for safe concurrent operations, inspecting and modifying state, and importing existing infrastructure into Terraform management.
Building on these foundations, the course delves into Managing Resources with advanced techniques such as defining implicit and explicit dependencies, using count and for_each for creating multiple instances dynamically, and implementing conditional resources. Participants will gain in-depth knowledge of Modules, learning how to effectively use existing modules from the Terraform Registry and, crucially, how to create their own reusable modules to promote code organisation and maintainability across projects. The training covers managing variables and their precedence, including automatic loading and usage in Terraform Cloud, and explores integrating with Secrets Management solutions to handle sensitive data securely within Terraform workflows. A key focus is placed on Collaboration Workflows, discussing strategies for using remote state, managing different environments or applications using Workspaces, and providing an overview of features available in Terraform Cloud/Enterprise like variable sets and policy as code. The course also introduces concepts and tools for Testing Terraform code (static analysis, linting) and strategies for Managing Configuration Drift, concluding with a dedicated module on real-world Terraform Best Practices and troubleshooting techniques (terraform fmt, terraform validate, logging, error messages). Through extensive hands-on labs using realistic scenarios, attendees will gain practical experience automating infrastructure across different providers.
Instructor-led online and in-house face-to-face options are available - as part of a wider customised training programme, or as a standalone workshop, on-site at your offices or at one of many flexible meeting spaces in the UK and around the World.
-
- Understand the concepts of Infrastructure as Code (IaC), the benefits of using Terraform, its architecture, installation, and core CLI workflow.
- Master the HashiCorp Configuration Language (HCL) to define infrastructure resources, data sources, providers, variables, locals, expressions, and functions.
- Understand and configure providers for various infrastructure platforms, including implementing secure authentication methods.
- Effectively manage Terraform state, including understanding state files, configuring local and remote backends (for multiple clouds and Terraform Cloud), implementing state locking, inspecting state, and importing existing infrastructure.
- Manage Terraform resources using advanced techniques like dependencies, iteration (count, for_each), and conditionals.
- Understand and effectively use Terraform Modules, including consuming existing modules from the Registry and creating your own reusable modules.
- Manage variables and their precedence, including automatic loading and usage in Terraform Cloud, and integrate with Secrets Management solutions to handle sensitive data securely within Terraform workflows.
- Understand and apply collaboration workflows with Terraform, using remote state backends and version control systems effectively.
- Utilise Terraform Workspaces for managing different environments or applications.
- Gain awareness of key features in Terraform Cloud/Enterprise, such as variable sets and policy as code (Sentinel).
- Understand concepts and apply basic techniques for testing Terraform code (static analysis, linting).
- Manage configuration drift and apply techniques for detection and handling.
- Implement Terraform best practices for code organisation, modularity, state management, and security.
- Debug and troubleshoot Terraform configurations and workflows effectively.
-
This 3-day intensive hands-on training course is designed for IT professionals who want to learn how to automate infrastructure provisioning and management using Terraform effectively in real-world, collaborative environments. It is ideal for:
Infrastructure Engineers
DevOps Engineers
Cloud Architects
Systems Administrators
Developers involved in infrastructure automation or cloud deployments
Anyone wanting to master Infrastructure as Code principles and practices using Terraform for production use cases.
-
Participants should have:
Familiarity with basic infrastructure concepts (servers, networking, storage).
Some understanding of cloud provider concepts (e.g., VPCs, VMs, Storage in AWS, Azure, or GCP – familiarity with at least one is beneficial).
Experience using a command-line interface (CLI).
No prior experience with Terraform is required.
We can customise the training to match your team's experience and needs - with more time and coverage of fundamentals such as working with the Command Line, or virtualisation / containerisation technologies.
-
This Terraform course is available for private / custom delivery for your team - as an in-house face-to-face workshop at your location of choice, or as online instructor-led training via MS Teams (or your own preferred platform).
Get in touch to find out how we can deliver tailored training which focuses on your project requirements and learning goals.
-
Introduction to Terraform and IaC
Understanding Infrastructure as Code (IaC) and its benefits.
Overview of Terraform architecture: Core, Providers, State.
Obtaining and installing Terraform.
The core Terraform CLI workflow: init, plan, apply, destroy.
Infrastructure lifecycle managed by Terraform.
Lab: Installing Terraform and running a basic configuration.
Terraform Language Fundamentals (HCL)
Introduction to the HashiCorp Configuration Language (HCL).
Defining Resources: Creating infrastructure objects.
Using Data Sources: Querying existing infrastructure or external data.
Understanding and configuring Terraform Providers: Interacting with different APIs.
Provider Authentication: Secure methods for authenticating with cloud providers (e.g., environment variables, credentials files, IAM roles, service principals - conceptual overview and configuration).
Input and output variables: Parameterizing configurations.
Complex variable types (lists, maps, objects).
Using Locals for reducing repetition.
Validation rules for input variables.
Interpolation syntax.
Expressions & Functions: Manipulating data within HCL.
Lab: Writing HCL configurations with resources, variables, and basic expressions.
Terraform State Management
Understanding the role of State in Terraform.
Managing state files: Local state.
State file structure.
Backend configuration: Configuring remote state backends (e.g., S3, Azure Blob Storage, GCS, Terraform Cloud).
State locking: Preventing concurrent operations on state.
Inspecting state (terraform state show, terraform state list).
Modifying state (terraform state rm, terraform state mv - use with caution).
Importing existing resources into Terraform state (terraform import).
Lab: Configuring remote state, inspecting state, importing a resource.
Managing Resources: Dependencies and Iteration
Implicit and Explicit Dependencies between resources.
Ordering Non-dependant Resources.
Using triggers for controlling resource updates.
Iterating on Resources:
Using count for simple iteration.
Using for_each for more complex iteration over maps or sets.
Implementing Conditional resources.
Lab: Managing resource dependencies, using count and for_each.
Modules: Using and Creating
Using Modules: Consuming modules from the Terraform Registry or local paths.
Creating your own reusable Modules:
Module structure and best practices.
Defining module input variables and output variables.
Module versioning.
Lab: Using an existing module from the Registry, creating a simple reusable module.
Variables, Secrets, and Environments
Environment Variables: Dealing with parameters via the environment.
Environment variable options and precedence.
Automatic loading of variables (.tfvars files).
Using Variables in Terraform Cloud.
Key built-in environment variables (TF_LOG, TF_VAR_name...).
Secrets Management Integration: Strategies for handling sensitive data (passwords, keys) without hardcoding.
Integrating Terraform with external Secrets Management solutions (e.g., HashiCorp Vault, cloud-specific secrets managers - conceptual overview).
Using sensitive variables and outputting sensitive data carefully.
Lab: Managing variables using multiple methods, exploring secrets handling concepts.
Collaboration Workflows and Workspaces
Collaboration Workflows with Remote State: Discussing best practices for team usage.
Terraform Workspaces: Using workspaces for managing different environments (dev, staging, prod) or applications.
Terraform Cloud/Enterprise Overview:
Workspaces in Terraform Cloud.
Variable Sets.
Policy as Code (Sentinel) overview.
Cost Estimation overview.
Lab: Using Terraform Workspaces.
Maintenance, Troubleshooting, and Best Practices
Workflows revisited: validate, fmt, taint, untaint, graph.
Debugging Terraform configurations and workflows.
Verbose Logging and log levels (TF_LOG).
Writing logs to files.
Understanding and interpreting Error messages.
Managing Drift: Detecting drift (terraform plan) and handling it (terraform refresh, terraform plan -refresh-only, terraform apply).
Testing Terraform Code (Introduction):
Static analysis and linting (tflint demo).
Security and compliance checking (checkov demo).
Introduction to integration testing concepts (e.g., Terratest - conceptual).
Terraform Best Practices:
Code organisation and structure.
Naming conventions.
Modularity and reusability.
State management strategies.
Security best practices (secrets, provider auth).
Lab: Debugging and troubleshooting exercises, running linting tools.
-
Terraform Documentation: The official and comprehensive documentation for Terraform.
Terraform Registry: The source for official and community providers and modules for various infrastructure platforms.
Terraform Cloud & Enterprise Documentation: Learn about features for teams and organisations using HashiCorp's managed service.
Provider Documentation (Examples):
TFLint: A widely used static analysis linter for Terraform.
Checkov: A static analysis tool to help secure cloud configurations and IaC.
HashiCorp Vault Documentation: Learn about a popular secrets management tool that integrates with Terraform.
Trusted by