WintelGuy.com

Terraform Associate Exam Cram - Part 1

Understand Infrastructure as Code (IaC) concepts

This is the Part 1 of the Terraform Associate Exam Cram. It covers the following Terraform Associate Certification exam objectives:

1a. Explain What IaC Is

Infrastructure as Code

  • Definition:
    • Infrastructure as Code (IaC) allows to manage and provision infrastructure through human-readable configuration files rather than manual processes (UI or CLI).
    • Treats infrastructure like application code: versioned, tested, repeatable.
  • Approaches:
    • Declarative (what you want) → You define what the infrastructure should look like. IaC tools, like Terraform, figure out how build it.
    • Imperative (how to do it) → You manually specify how to build infra step by step using scripts or CLI.
  • Core principle: Desired state is defined in code → IaC tools reconcile real infrastructure with this desired state.
    • Desired state → what you define in code.
    • Current state → what exists in the environment.

What is Terraform?

HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share.

Terraform creates and manages resources through plug-ins, called providers. Providers enable Terraform to work with virtually any platform or service manageable though API. HashiCorp and the Terraform community have already written thousands of providers to manage many different types of resources and services. You can find all publicly available providers on the Terraform Registry, including Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog, and many more.

Terraform configuration files are declarative, meaning that they describe the end state of your infrastructure. Terraform handles all interactions and underlying logic necessary to create the resources. It builds a resource graph to determine resource dependencies and creates or modifies non-dependent resources in parallel.

Terraform supports reusable configuration components called modules that define configurable collections of infrastructure. You can use publicly available modules from the Terraform Registry, or write your own.

Since your configuration is written in a file, you can commit it to a Version Control System (VCS) and use HCP Terraform to efficiently manage Terraform workflows across teams. HCP Terraform runs Terraform in a consistent, reliable environment and provides secure access to shared state and secret data, role-based access controls, a private registry for sharing both modules and providers, and more.

1b. Describe Advantages of IaC Patterns

Benefits of IaC:

  • Consistency & Repeatability & Idempotence: Same configuration produces identical infrastructure across environments; ensures reproducibility.
  • Drift Detection: Identify and prevent infrastructure changes made outside of configuration code.
  • Version Control & Auditability: Store configs in Git or other VCS; track history, enable rollback, and support peer review.
  • Automation & Speed: Deploy infrastructure faster, at scale; reduce manual steps and human error; enable CI/CD integration.
  • Self-describing infrastructure: The code itself provides comprehensive information about the infrastructure’s current state, enhancing maintainability and understanding.
  • Collaboration: Shared codebase supports teamwork across development and operations.
  • Scalability & Reusability: Modular configs can be reused across projects and environments.
  • Testability & Validation: Validate infrastructure configs like application code before deployment.
  • Governance & Compliance: Enforce policies and standards programmatically.
  • Cost Control: Create and destroy infrastructure on demand for optimized resource usage.

Back to Top

Practice Questions

What is the main goal of Infrastructure as Code (IaC)?
What resources can be managed by Terraform?
How can you use infrastructure as Code (IaC) to resolve issues caused by inconsistent VM configuration across multiple environments?
What is the main advantage of using Infrastructure as Code (IaC)?
How does Infrastructure as Code (IaC) improve consistency in infrastructure deployments?
What is declarative Infrastructure as Code (IaC)?
How does version control support Infrastructure as Code (IaC) practices?
You discovered that staging and production environments differ even though both should be identical. How can Infrastructure as Code (IaC) help prevent this issue?

Back to Top