📜

HashiCorp Terraform Exam Preparation Notes

Jun 28, 2024

HashiCorp Terraform Associate Exam (v3)

Introduction

  • Instructor: Andrew Brown
  • Course available on FreeCoCamp.
  • Utilizes:
    • Theoretical content
    • Practical labs
    • Practice exams

Course Objectives

  • Obtain the HashiCorp Terraform Associate certification.
  • Demonstrate skills in DevOps and infrastructure automation.
  • Improve employment prospects in Cloud and DevOps roles.

Course Structure

  • Content divided into sections: theory and practice.
  • Format: a mix of lectures and labs (aiming to solidify knowledge through constant practice).

Initial Recommendations

  • It's recommended to learn the basics of AWS, Google Cloud, and Azure before Terraform.
  • Ideally, have some level of cloud associate certification.
  • Growing demand in the job market for Terraform.
  • The exam is not difficult but learning Terraform can be confusing.

Multi-Cloud Roadmap

  • Start with a cloud Associate certification (AWS SysOps, Azure Admin, or Google Ace).
  • Then proceed with specialized certifications like Terraform Associate.
  • Complete with other advanced certifications (Vault, Cloud Security, etc).

Study Duration

  • Beginners: up to 30 hours or more.
  • With experience in IaC: around 12 hours.
  • General recommendation: 1 to 2 hours daily over 14 days.

Exam Details

  • Focuses on practical knowledge and use of Terraform.
  • Importance of conducting labs and practice exams.
  • Evaluation system through weighted scoring.
  • Required 70% to pass.
  • Exam format: multiple choice and short answer (commands).

Exam Contents

Knowledge Domains (Nine in Total)

  1. Basic Concepts of IaC and Terraform:
    • Declarative vs Imperative
    • Popular methods and tools
    • Examples: ARM, CloudFormation, BICEP
  2. Understanding Basic Terraform:
    • Purpose of Terraform
    • Commands: init, validate, plan, apply, destroy
  3. Beyond the Basic Workflows:
    • Import existing infrastructures
    • View Terraform State
    • Enable detailed logging
  4. Interacting with Modules:
    • Contrast and use different module source options
    • Module variables and submodules
  5. Implementing and Maintaining State:
    • Work with local and remote states
    • Resource drift management
  6. Re-generation and Configuration Modification:
    • Use of variables and outputs
    • Connection between resources
  7. Terraform Cloud Capabilities:
    • Infrastructure management and collaboration using Terraform Cloud
  8. Automating Changes:
    • Action planning/planning and execution
  9. IaC Security Practices:

Recertification and Validity

  • Certification validity for 24 months.
  • Option to take the new exam starting 18 months after the previous certification.

Additional Practices

  • Use of .tfvars files to pass values to multiple variables at once.
  • Advanced techniques like spread operators (*), filtering, and more.
  • State management and related commands.

Provisioners in Terraform

  • Last resort for provisioning specific tools.
  • Examples: Cloud init and Packer.

Terraform Cloud

Featured Characteristics

  • Remote state management
  • Version control integration
  • Workspace management
  • Secure storage of variables
  • Remote execution
  • Private module registry
  • Team and permission management
  • Cost estimation

Terraform Cloud Architecture

  • Organization and Workspaces
  • Permission levels

Version Control System (VCS) Integration

  • Support for: GitHub, GitLab, Bitbucket, Azure DevOps, etc.
  • Workflows: Automated, API-controlled, and CLI

Security and Costs

  • Free plan: Up to 5 users
  • Teams plan: $20 USD per user
  • Advanced features available in higher plans (Governance, Audits, etc.)

Uses of Terraform Cloud Agents

  • Use in disconnected or private environments

Sentinel Implementation

  • Sentinel: policy as code framework
  • Issuing warnings and rejections based on specific policies.
  • Applied post-plan, pre-apply changes in Terraform.
  • Paid software, available in Team & Governance.

Complementary Tools

Packer

  • HashiCorp tool for image creation.
  • Use of AMI, other cloud providers.
  • Integration with CI/CD pipelines and Terraform.

Vault

  • Secure storage and management of secrets.
  • Use of short-lived secret injections.
  • Integration with Terraform to inject variables upon apply.

Consul

  • Service networking platform.
  • Remote state storage and provider for Terraform.

Atlantis

  • Tool for automating Terraform pull requests.
  • Alternative to Terraform Cloud.

CDK for Terraform

  • Use of AWS CDK to generate Terraform templates.
  • Support for multiple languages like Python, Typescript, etc.

Gruntwork

  • Company that produces tools compatible with Terraform.
  • Featured Tools: Terra Grunt for keeping Terraform configurations more D.R.Y.