QUESTION 1. The terraform.tfstate file always matches your currently built infrastructure.
A. True
B. False
QUESTION 2. Which of the following is not true of Terraform providers?
A. Providers can be written by individuals
B. Providers can be maintained by a community of users
C. Some providers are maintained by HashiCorp
D. Major cloud vendors and non-cloud vendors can write, maintain, or collaborate on Terraform providers
E. None of the above
QUESTION 3. You should store secret data in the same version control repository as your Terraform configuration.
A. True
B. False
QUESTION 4. You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with
Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? (Choose two.)
A. Provision new VMs using Terraform with the same VM names
B. Use the terraform import command for the existing VMs
C. Write Terraform configuration for the existing VMs
D. Run the terraform import-gcp command
QUESTION 5. terraform init initializes a sample main.tf file in the current directory.
A. True
B. False
QUESTION 6. Which two steps are required to provision new infrastructure in the Terraform workflow? (Choose two.)
A. Destroy
B. Apply
C. Import
D. Init
E. Validate
QUESTION 7. Terraform requires the Go runtime as a prerequisite for installation.
A. True
B. False
QUESTION 8. When should you use the force-unlock command?
A. You see a status message that you cannot acquire the lock
B. You have a high priority change
C. Automatic unlocking failed
D. Your apply failed due to a state lock
QUESTION 9. You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)
A. Run terraform plan -destroy.
B. This is not possible. You can only show resources that will be created.
C. Run terraform state rm *.
D. Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.
QUESTION 10. What does the default “local” Terraform backend store?
A. tfplan files
B. Terraform binary
C. Provider plugins
D. State file
QUESTION 11. What value does the Terraform Cloud/Terraform Enterprise private module registry provide over the public Terraform Module Registry?
A. The ability to share modules with public Terraform users and members of Terraform Enterprise Organizations
B. The ability to tag modules by version or release
C. The ability to restrict modules to members of Terraform Cloud or Enterprise organizations
D. The ability to share modules publicly with any user of Terraform
QUESTION 12. You have declared a variable called var.list which is a list of objects that all have an attribute id. Which options will produce a list of the IDs? (Choose two.)
A. { for o in var.list : o => o.id }
B. var.list[*].id
C. [ var.list[*].id ]
D. [ for o in var.list : o.id ]
QUESTION 13. When using a module block to reference a module stored on the public Terraform Module Registry such as:
module “consul” {
source = “hashicorp/consul/aws”
}
How do you specify version 1.0.0?
A. Modules stored on the public Terraform Module Registry do not support versioning
B. Append ?ref=v1.0.0 argument to the source path
C. Add version = “1.0.0” attribute to module block
D. Nothing – modules stored on the public Terraform Module Registry always default to version 1.0.0
QUESTION 14. Which option can not be used to keep secrets out of Terraform configuration files?
A. A Terraform provider
B. Environment variables
C. A -var flag
D. secure string
QUESTION 15. What is one disadvantage of using dynamic blocks in Terraform?
A. They cannot be used to loop through a list of values
B. Dynamic blocks can construct repeatable nested blocks
C. They make configuration harder to read and understand
D. Terraform will run more slowly
QUESTION 16. Only the user that generated a plan may apply it.
A. True
B. False
QUESTION 17. Examine the following Terraform configuration, which uses the data source for an AWS AMI. What value should you enter for the ami argument in the AWS instance resource?
data “aws_ami” “ubuntu” {
…
}
resource “aws_instance” “web” {
ami = ——————-
instance type = “t2.micro”
tag = {
Name = “HelloWorld”
}
}
A. aws_ami.ubuntu
B. data.aws_ami.ubuntu
C. data.aws_ami.ubuntu.id
D. aws_ami.ubuntu.id
QUESTION 18. What is the name assigned by Terraform to reference this resource?
resource “azurerm_resource_group” “dev” {
name = “test”
location = westus”
}
A. dev
B. azurerm_resource_group
C. azurerm
D. test
QUESTION 19. Where in your Terraform configuration do you specify a state backend?
A. The terraform block
B. The resource block
C. The provider block
D. The datasource block
QUESTION 20. How would you reference the “name” value of the second instance of this fictitious resource?
resource “aws_instance” “web” {
count = 2
name = “terraform-${count.index}”
}
A. element(aws_instance.web, 2)
B. aws_instance.web[1].name
C. aws_instance.web[1]
D. aws_instance.web[2].name
E. aws_instance.web.*.name