How to Ace Hashicorp terraform associate exam in a week?

In recent years Terraform has become a well-known name in the cloud community and Knowing terraform is a primary requirement for most of the devops jobs these days. It certainly helps if you are a terraform certified professional.

What is Terraform and why do we need it?

Terraform is the most popular IAC tool these days. IAC stands for infrastructure as a code, and it has become the industry standard to create and manage infrastructure. 

The best thing about Terraform is that it is cloud agnostic (meaning you can use it for almost all cloud providers) and open source.

Few things to know about terraform

  • It uses declarative language based on HCL to define the configuration. It’s simple and easy to learn, and you don’t need programming skills to write it. 
  • Terraform is Idempotent, meaning you can run the same code multiple times and it will give you the same result.
  • It’s repeatable, you can use the same configuration to provide infra for multiple environments(prod, dev, and staging).
  • Managing dependencies(explicit and implicit dependencies) is a cakewalk in Terraform.

Now coming to the certification part.

Terraform offer 3 certification. Terraform, Vault and Consul.

The Terraform Associate certification is for Cloud Engineers who specialize in operations, IT, or development and have a good understanding of the fundamental concepts and skills related to the open source IAC too Terraform by HashiCorp.

The most popular terraform certification is the associate one and that is the focus of this article. It has 3 years of validity. 

If you have some working experience then you can easily clear it after a few hours of preparation. Even if you have never used it, you can easily Ace the certification with a week of preparation.

Terraform certification details

60 minutes to answer 57 questions.
Price: 70.5$ + Tax
Online proctored

Questions format

Terraform certification is easier compare to other cloud certifications. You have 57 multiple-choice, multiple-answer, single answers with a mix of some true/false questions.

There will be a few questions where you have to find the correct syntax to fill in the missing blanks in a piece of code. A few questions will be terraformed commands/subcommands.

At the time of writing this article, you have two options to pick from, 002 and 003. 003 is the new one which leaves out a few topics. 
You can take either one, 002 will be valid for a few years until everyone’s certification get expired.

Here is the link for both

Terraform associate 003
Terraform associate 002

Study plan

To pass the certification exam, you need to have an understanding of the basic components and fundamental concepts like 

  • resources, and null resources
  • Data sources
  • Outputs
  • Variables — ways to use them and their precedence 
    locals 
  • Providers (also understand how >= is different that ~=)
  • Provisioners (This is removed in 003, only valid in 002)
  • Functions – merge, try, can, lookup- Note that Terraform doesn’t support custom functions like high-level programming languages.
  • Loops — for_each and count and how count can be used for conditional logic
  • Modules — Why modules are important, how to use create and use modules, how to access the output from modules, and use in configuration.
  • Dynamic blocks — What they are, Why we need them, and syntax.
  • State management: This is going to be an important topic as you will see multiple questions from it. Also, read about how the state affects by manual change and how to pull resources created outside terraform configuration in your existing configuration and state.
  • Taint and Untaint resources — (only for 002, it is removed in 003)
  • You need to have some experience playing with complex data types and how they are used. Below are the data types Terraform supports. 
    string, bool, int, list, tuple, map, object.

You also need to know the basic terraform commands. If you type Terraform — help, it will show all the commands and their use cases. Check the sub-commands as well.

terraform --help
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

Main commands:
  init          Prepare your working directory for other commands
  validate      Check whether the configuration is valid
  plan          Show changes required by the current configuration
  apply         Create or update infrastructure
  destroy       Destroy previously-created infrastructure

All other commands:
  console       Try Terraform expressions at an interactive command prompt
  fmt           Reformat your configuration in the standard style
  force-unlock  Release a stuck lock on the current workspace
  get           Install or upgrade remote Terraform modules
  graph         Generate a Graphviz graph of the steps in an operation
  import        Associate existing infrastructure with a Terraform resource
  login         Obtain and save credentials for a remote host
  logout        Remove locally-stored credentials for a remote host
  output        Show output values from your root module
  providers     Show the providers required for this configuration
  refresh       Update the state to match remote systems
  show          Show the current state or a saved plan
  state         Advanced state management
  taint         Mark a resource instance as not fully functional
  test          Experimental support for module integration testing
  untaint       Remove the 'tainted' state from a resource instance
  version       Show the current Terraform version
  workspace     Workspace management

Global options (use these before the subcommand, if any):
  -chdir=DIR    Switch to a different working directory before executing the
                given subcommand.
  -help         Show this help output, or the help for a specified subcommand.

Some important concepts

  • What is IAC and why do we need it?
  • How remote state is better than local state
  • How state management works in terraform and how state locking works.
  • Best practice for storing sensitive information

There will be a few questions from Terraform Cloud so it’s best not to ignore it. 

Questions will be like, what are the advantages ( Increased security, cost estimation, policy enforcement) of using Terraform cloud?

What is the workspace and its advantages? and a possible question related to sentinel policies.

You can refer to Terraform documentation, they have done a good job explaining every topic.

Read about the above-mentioned topics, run through some youtube videos, Go through some practice sets and you are set. 

For the people who don’t have hands-on experience with Terraform or are new to Terraform, You can follow along with some youtube videos. Create some basic resources and run terraform commands. Try to do basic stuff like creating a VM, storage bucket, network, subnet, etc. Use variables, locals, and output for a better understanding of how it all works. 

Go through the topics I have mentioned earlier, understand the basic concepts and you will be able to clear the exam. Don’t worry if you missed a few topics, you just need to get 70% to get certified.

Akhilesh Mishra

Akhilesh Mishra

I am Akhilesh Mishra, a self-taught Devops engineer with 11+ years working on private and public cloud (GCP & AWS)technologies.

I also mentor DevOps aspirants in their journey to devops by providing guided learning and Mentorship.

Topmate: https://topmate.io/akhilesh_mishra/