Terragrunt: Infrastructure as Code Management
Terragrunt: Infrastructure as Code Management
Up to 20 questions, shuffled on every run
Welcome to the Terragrunt Basics Quiz! This quiz covers fundamental Terragrunt concepts, including DRY configuration management, remote state handling, module dependencies, and best practices for managing Terraform at scale. Each question is multiple-choice, and you’ll find hints to help you along the way. Good luck!
Answer key and explanations20 questions
The quiz above draws 20 questions at random from these 30, so a second attempt will not be the same run. Everything in the pool is listed here.
What is the primary purpose of Terragrunt?
AnswerTo maintain DRY configurations and automate remote state logic
Which file name is the standard configuration entry point for Terragrunt?
Answer`terragrunt.hcl`
What does the "include" block do in a terragrunt.hcl file?
AnswerIt enables a configuration to inherit settings from a parent
What is the "dependency" block used for?
AnswerTo pass output variables between independent infrastructure modules
How do you run "terraform apply" across multiple directories using Terragrunt?
Answer`terragrunt run-all apply`
What is the purpose of the "remote_state" block?
AnswerTo automate backend configuration and the creation of state buckets
What does the "source" attribute in a Terragrunt block define?
AnswerThe location of the Terraform module code to be deployed
What is the role of "Before" and "After" hooks?
AnswerTo execute custom commands during the Terraform lifecycle
What is the "find_in_parent_folders()" function used for?
AnswerTo locate a parent configuration file for easier inheritance
How does Terragrunt handle "Inputs"?
AnswerIt maps the HCL inputs block to Terraform variables
What is the "Locals" block in Terragrunt?
AnswerA block for defining reusable variables within a configuration
What command would you use to see what Terragrunt plans to do without making changes?
Answer`terragrunt plan`
What is the purpose of "generate" blocks?
AnswerTo inject HCL code directly into the Terraform directory
What happens when you use "terragrunt run-all destroy"?
AnswerIt destroys all modules in the reverse order of dependencies
What is the ".terragrunt-cache" folder?
AnswerThe directory where Terragrunt runs Terraform commands
Which function converts a string into an HCL object?
Answer`read_terragrunt_config()`
What is the "iam_role" attribute used for in Terragrunt?
AnswerTo assume a specific IAM role before executing Terraform
What is a "Mock Output"?
AnswerA placeholder value used when a dependency is not yet deployed
How do you tell Terragrunt to use a specific version of Terraform?
Answer`terraform_version_constraint = ">= 1.0.0"`
What does the "--terragrunt-non-interactive" flag do?
AnswerIt assumes a "yes" response to all interactive prompts
What is the "get_env()" function used for?
AnswerTo retrieve environment variables from the host system
What is "Prevent Destroy"?
AnswerA flag that prevents the accidental deletion of a module
Which command clears the Terragrunt cache?
Answer`rm -rf .terragrunt-cache`
What is the "path_relative_to_include()" function?
AnswerThe relative path from the root to the child config
What is "Sops" integration in Terragrunt?
AnswerA method for decrypting Mozilla SOPS files at runtime
How do you pass extra arguments to Terraform via Terragrunt?
Answer`extra_arguments "custom" { arguments = ["-lock=false"] }`
What is the purpose of "skip = true" in a Terragrunt configuration?
AnswerTo ignore a directory during "run-all" executions
What is a "Terragrunt Stack"?
AnswerA set of modules deployed together via "run-all"
What does "get_terragrunt_dir()" return?
AnswerThe absolute path to the current HCL file directory
Why would you use Terragrunt over plain Terraform?
AnswerTo reduce code duplication in large deployments








