71. You can develop a custom provider to manage its resources using Terraform.
A. True
B. False
Answer
A
72. Which of these is not a benefit of remote state?
A. Keeping unencrypted sensitive information off disk
B. Easily share reusable code modules
C. Working in a team
D. Delegate output to other teams
Answer
B
73. When using multiple configurations of the same Terraform provider, what meta-argument must be included in any non-default provider configurations?
A. depends_on
B. alias
C. id
D. name
Answer
B
74. A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don’t know which VM Terraform manages but do have a list of all active VM IDs.
Which of the following methods could you use to discover which instance Terraform manages?
A. Run terraform taint/code on all the VMs to recreate them
B. Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs
C. Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages
D. Use terraform refresh/code to find out which IDs are already part of state
Answer
C
75. Which of the following is not considered a safe way to inject sensitive values into a Terraform Cloud workspace?
A. Edit the state file directly just before running terraform apply
B. Set the variable value on the command line with the -var flag
C. Write the value to a file and specify the file with the -var-file flag
Answer
A
76. If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform init.
A. True
B. False
Answer
B
77. You must initialize your working directory before running terraform validate.
A. True
B. False
Answer
A
78. If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
A. Manually update the state fire
B. Remove the resource definition from your file and run terraform apply -refresh-only
C. Run terraform import
D. It will happen automatically
Answer
B
79. You created infrastructure outside of the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
A. terraform init
B. terraform get
C. terraform refresh
D. terraform import
Answer
D
80. When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)
A. When you change a Terraform-managed resource via the Azure Cloud Console, Terraform updates the state file to reflect the change during the next plan or apply
B. Changing resources via the Azure Cloud Console records the change in the current state file
C. When you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file
D. Changing resources via the Azure Cloud Console does not update current state file
Answer
D