21. In an HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs automatically when you merge or commit change to version control.
A. True
B. False
Answer
A
22. A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?
resource "goole_compute_instance" "main" {
name = "test"
}
A. test
B. main
C. google
D. compute_instance
Answer
B
23. A module block is shown in the Exhibit space of this page.
When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?
module "consul" {
source = "hashicorp/consul/aws"
}
A. You cannot. Modules stored on the public Terraform Registry do not support versioning.
B. Add a version = “1.0.0” attribute to the module block.
C. Nothing. Modules stored on the public Terraform module Registry always default to version 1.0.0.
D. Append ?ref=v1.0.0 argument to the source path.
Answer
B
24. Which syntax check errors when you run terraform validate?
A. The code contains tabs for indentation instead of spaces.
B. There is a missing value for a variable.
C. The state file does not match the current infrastructure.
D. None of the above.
Answer
D
25. Terraform encrypts sensitive values stored in your state file.
A. True
B. False
Answer
B
26. When should you run terraform init?
A. Every time you run terraform apply
B. After you run terraform plan for the first time in a new Terraform project and before you run terraform apply
C. After you start coding a new Terraform project and before you run terraform plan for the first time
D. Before you start coding a new Terraform project
Answer
C
27. You are making changes to the existing Terraform code to add some new infrastructure.
When is the best time to run terraform validate?
A. After you run terraform plan so you can validate that your state file is consistent with your infrastructure
B. Before you run terraform plan so you can validate your code syntax
C. Before you run terraform apply so you can validate your infrastructure
D. After you run terraform apply so you can validate your provider credentials
Answer
B
28. Which of these commands makes your code more human readable?
A. terraform validate
B. terraform output
C. terraform show
D. terraform fmt
Answer
D
29. What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
A. terraform plan -refresh-only
B. terraform show -json
C. terraform apply -lock-false
D. terraform plan -target-state
Answer
A
30. Which command must you first run before performing further Terraform operations in a working directory?
A. terraform plan
B. terraform workspace
C. terraform init
D. terraform import
Answer
C