I passed my Terraform Associate Certification Exam today and wanted to share my experience to help others who are preparing to do the same. There are many other posts out there on this topic that are quite good, so I thought I would try to take a slightly different approach.
The Approach
Rather than doing what I might normally do and spend considerable time studying the available material, I decided to take the exam without studying to see where some of the most challenging parts might be to help those earlier in their Terraform journey focus they learning.
My Experience
I have been using Terraform professionally as an infrastructure as code platform since 2018. Some examples of things that I have worked on include:
- Driving adoption of an everything-as-code culture and development best practices
- Creating modular infrastructure code that follows the build once deploy anywhere paradigm
- Implementing new and syncing existing infrastructure at scale for hundreds of applications across all environments
- Optimizing change management processes to enable smaller and more frequent deployments to production with more reliable rollback and fail forward strategies
- Building reusable Terraform modules to support developer enablement and scale across large enterprises
- Using infrastructure-as-code to improve fault tolerance across availability zones, regions, and clouds.
Exam Results
Status: Pass
Overall Score: 91%
Breakdown by content area:
1.0 Understand infrastructure as code (IaC) concepts: 100%
2.0 Understand Terraform’s purpose (vs other IaC): 100%
3.0 Understand Terraform basics: 100%
4.0 Use the Terraform CLI (outside of core workflow): 66%
5.0 Interact with Terraform modules: 83%
6.0 Navigate Terraform workflow: 100%
7.0 Implement and maintain state: 100%
8.0 Read, generate, and modify configuration: 81%
9.0 Understand Terraform Cloud and Enterprise capabilities: 100%
Exam Summary
Overall, the exam was very straight forward. It was 57 questions and you are given one hour to complete it. To pass the requires a score of 70% or higher. Passing the exam will certify you as a Terraform Associate for two years.
HashiCorp provides a great outline of exam objectives and ample resources to study including:
- A study guide that is well aligned with the objectives
- Sample questions to get an idea of the test format
- A review guide that maps objectives to Terraform docs
All topics listed in the objectives and guides are on the exam. Not having to study for things that don’t matter makes it simple to prepare for and pass the exam with some measure of confidence. Also, because Terraform is lower in complexity than a cloud provider, for example, HashiCorp is able to effectively test you on 95% of the concepts within the scope of the exam.
It is worth noting that the exam is not necessarily up-to-date with the latest version of Terraform. For example, there are still references to the “terraform taint” command when discussing destroying and recreating resources which was deprecated in Terraform version 0.15.x by the “-replace” option in the “apply” command. As of this writing, the exam covers Terraform version 0.14.x+.
Study Time
The amount of study time you will need depends greatly on your actual experience writing, deploying, and managing Terraform configurations. I’ll classify study time in this section based on the below user profiles with an expectation of making an 75+ on the exam:
- Beginner – You have exposure to cloud and infrastructure-as-code concepts, but you lack experience with Terraform.
- Intermediate – You have experience with Terraform and can use the basic workflow, but you don’t understand more advanced concepts or have not used it professionally.
- Advanced – You have solid and sustained practical experience writing and deploying Terraform configurations and understand more advanced concepts.
- Expert – You have years of professional experience using the majority of Terraform’s functionality and are comfortable with both open source Terraform and Terraform Cloud / Enterprise.
Beginners should expect between 12 and 24 hours of study time. This includes getting some practical experience using the Terraform CLI, writing Terraform scripts, and studying the core concepts from the review guide.
Intermediate users should expect between 8 and 12 hours of study time. This includes going through the entire review guide and identifing areas where you have a gap in experience. Ideally, you should then practice those by writing and testing Terraform code to gain real practical knowledge.
Advanced users should expect between 1 and 4 hours of study time. This includes going through the review guide and selecting those areas where you have had less exposure in your day-to-day work.
Experts can pass this exam with very little to no study. If you have been working professionally with Terraform for many years and feel confident about the review guide materials, you could plan to just schedule and take the exam.
These estimates are based on what is required to “pass” the exam. To master the concepts will take more time and thoughtful practice.
Types of Questions
The types of questions you will see on the exam are:
- Single choice
- Multiple choice
- Boolean (true or false)
- Fill in the blank
Roughly speaking, the mix of these types questions was something like 65% single choice, 15% boolean, 15% multiple choice, and less than 5% fill in the blank.
There was at least one question for all of the objectives stated in the exam’s study guide and nothing that was unexpected or purposefully worded to be more confusing that it had to be. Some questions were situational while others focused on practical knowledge of either Terraform or HCL.
Areas of Focus
As mentioned previously, the objective overview that HashiCorp provides does a great job of outlining what is covered in the exam. With that said, in this section I provide some color as to where I felt the focus of the exam was to help maximize the effectiveness of study time based on your level of experience.
I’d like to note that I don’t have any insight into how variant the exam might be from person to person. In other words, I can’t guarantee that my experience will be identical to yours. However, I would image the overall proportion of questions within a given category would be relatively consistent across participants when looked at in relative terms. Furthermore, I am bucketing these areas based on my recollection, which could be partially or entirely suspect.
Going forward, I will bucket areas of focus into one of the following categories:
- Major – There was a major focus on these topics with approximately 25% of the exam (15 questions) being comprised of questions in the category.
- Minor – There was minor focus on these topics with approximately 10% of the exam (6 questions) being comprised of questions in the catetory.
- Mention – There was a mention of these topics with approximately 3% or less of the exam (1-2 questions) being comprised of questions in the category.
Major Focus
The following major areas of focus make up approximately 50% of the overall exam.
- Standard Terraform commands and workflow – This maps to the Navigate Terraform workflow section of the exam (section 6: all). There was signifiant focus around how to implement Terraform workflow and use the “init”, “plan”, “apply”, and “destroy” commands. There was not much focus on all of the command options and flags, but two notable instances were when to use the “-refresh-only” flag when using “init” and “-target” option when using “apply”. There was no focus on how this fits into the larger paradigm of DevOps and CI/CD. For example, “-auto-approve” and “-no-color” flags.
- Non-standard Terraform commands – This maps to the Use the Terraform CLI (outside of core workflow) section of the exam (section 4: all). The focus for these questions was around how and when to use commands like “fmt”, “validate”, “import”, “taint”, “workspace”, and “state”. Similar to the core terraform commands, there was not a heavy emphasis on the various flags and options that each supports. It was important to know about how these commands fit into the workflow and what actions they cause. For example, “taint” would be done before plan and causes deletion and recreation.
The important things to ace this section is to have a solid understanding of core Terraform workflow and brush up on some of the non-standard commands documentation. These questions were some of the more situational in the exam.
For more information on Terraform commands, check out my Essential Terraform Cheatsheet!
Minor Focus
The following minor areas of focus make up approximately 30% of the overall exam.
- Providers – This maps to the Understand Terraform basics section of the exam (section 3: 3a-3d). These questions focused on the different sources for providers, when and how providers were installed in the local workspace (e.g. “init”), how to manage provider versions, how to create a provider alias, how the provider used is determined (“default” vs. “aliased”), and how to reference aliased configurations in a resource. I did not see any questions on provider authentication or configuring provider blocks with things like a region.
- Modules – This maps to the Interact with Terraform modules section of the exam (section 5: all). There was a heavy focus in modules around the relationship between parent and child modules and in particular in the context of variable scopes and outputs. There were also questions about how to reference a modules outputs in a configuration (“addressing”), whether or not all modules in the public registry are shown by default (only “verified” modules are), and how to define a module version.
- State and backend configuration – This maps to the Implement and maintain state and Understand Terraform’s purpose (vs other IaC) sections of the exam (section 7, section 2: 2b). State was an important topic that was also somewhat intermingled with the non-standard terraform commands. The important things to know about state were local vs. remote backends, how to migrate backends (workflow around that), state locking and why it matters, available backends for remote state, how to refresh state and what state refresh does, what a partial configuration is (when some or all backend variables are passed on the command line using the “-backend-config” option), and knowledge that secrets are in plain text in the state and that some backends offer encryption, including Terraform Cloud and Enterprise.
The important things to ace this section are to have a basic knowledge of provider sources, versioning, and usage, dig into the module documentation (in particular around variable scopes and referencing module attributes), and know about how to manage state properly.
Mentions
The following mentioned topics make up approximately 20% of the overall exam.
- Basic infrastructure-as-code concepts – This maps to the Understand Infrastructure as Code (IaC) concepts and Understand Terraform’s purpose (vs other IaC) sections of the exam (section 1: all, section 2: 2a). All of these were fairly straightforward so any knowledge about IAC would likely allow you to get these ones right.
- Provisioners – This maps to the Understand Terraform basics section of the exam (section 3: 3e). The important things to know here were when to use provisioners, the difference between “local-exec” and “remote-exec”, how to configure a provisioner (using a “provisioner” block in the resource), and how to create a connection with “remote-exec” (using the “connection” block).
- Terraform Cloud and Enterprise – This maps to the Understand Terraform Cloud and Enterprise capabilities section of the exam (section 9: all). Questions in this category were around the basic features of TC and TE (policies, permissions, remote state storage, etc.), the difference between them, and what Sentinel is and where in a “Run” policies are processed.
- Variables and outputs – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8a). Just know how to reference a variable and output and what a variable and output resource look like.
- Secrets management – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8b). Just know plain text secrets in code are bad and you can pass them on the command line using “-var” or environment variables at runtime.
- Data structures and types – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8c). Know the data types that terraform supports. In particular the complex types.
- Data sources – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8d). You need to know what a data source is, what a data block looks like, and how to reference data attributes.
- Resource addressing – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8e). You need to know how to use a resources attributes in your configuration. You should know this for data sources, outputs, modules, resources, etc.
- Functions – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8f). Know what functions are valid in Terraform and be able to identify, given a list of functions, which ones are not supported. It might also be good to know Terraform does not support user-defined functions (UDF’s), although that was not on my exam.
- Dynamic blocks – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8g). There was one question on this. It was just important to know how dynamic blocks look at work.
- Dependency management – This maps to the Read, generate, and modify configuration section of the exam (section 8: 8h). The important concept here is implicit vs. explicit dependencies. Make sure you know that Terraform will try to create a dependency graph based on your configuration and in cases where Terraform could not know implicitly that you can use a “depends_on” block to specify them explicitly.
There were no questions on lifecycle.
The important things to ace this section of the exam is to do some light review of the topics above, but more importantly actually write a little code. When it comes to writing configurations, having done it will always serve you better than having watched or read about it.
Study Plan
- The best way to start preparing is to go over the review guide provided by Terraform that points you to the relevant documentation.
- If you have not used Terraform much, it is recommended to complete some of the HashiCorp Learn tutorials to get some hands-on experience.
- For practice questions, I recommend this awesome article on Medium.
- For a video based guide, I recommend this video from free code camp.
Conclusion
I hope that this approach to breaking down the exam was helpful for those looking to become a certified Terraform Associate. Regardless of where you are on your journey, I wish you the best in achieving your learning goals.
Leave a Reply