1. terraform init retrieves and caches the configuration for all remote modules.
A. True
B. False
Answer
A
2. Terraform configuration can only call modules from the public registry.
A. True
B. False
Answer
B
3. A resource block is shown below. How would you reference the attribute name of this resource in HCL?
resource "kubernetes_namespace" "example" {
name = "test"
}
A. data.kubernetes_namespace.name
B. resource.kubernetes_namespace.example.name
C. kubernetes_namespace.test.name
D. kubernetes_namespace.example.name
Answer
D
4. You want to use API tokens and other secrets within your team’s Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Choose three.)
A. In a terraform.tfvars file, securely managed and shared with your team.
B. In HashiCorp Vault.
C. In a terraform.tfvars file, checked into your version control system.
D. In a plaintext document on a shared drive.
E. In an HCP Terraform/Terraform Cloud variable, with the sensitive option checked.
Answer
A, B, E
5. What happens when you execute terraform plan?
A. Imports all of your existing cloud provider resources to the state.
B. Installs all providers and modules referenced by configuration.
C. Compares your Terraform code and local state file to the remote state file in a cloud provider and determines if any changes need to be made.
D. Refreshes your state, then compares your state file to your Terraform configuration and creates an execution plan if any changes need to be made.
Answer
D
6. What does terraform destroy do?
A. Destroys the Terraform state file, leaves the infrastructure intact.
B. Destroys all Terraform code files in the current directory, leaves the state file intact.
C. Destroy all infrastructure in the Terraform state file.
D. Destroys all infrastructure in the configured Terraform provider.
Answer
D
7. When you include a module block in your configuration that references a module from the Terraform Registry, the “version” attribute is required.
A. True
B. False
Answer
B
8. Your root module contains a variable named num.servers. Which is the correct way to pass its value to a child module with an input named servers?
A. ${var.num.servers}
B. servers = num.servers
C. servers = var(num.servers)
D. servers = var.num_servers
Answer
D
9. What is the default local Terraform backend store?
A. Provider plugins
B. Terraform binary
C. tfplan files
D. State file
Answer
D
10. It is _________ to change the Terraform backend from the default “local” backend to a different one after performing your first terraform apply.
A. mandatory
B. optional
C. impossible
D. discouraged
Answer
B