Questions and Answers Correct
The 'terraform.tfstate' file always matches your currently built infrastructure?
False
One remote backend configuration always maps to a single workspace?
False. Remote backend can work with either a single Terraform Cloud workspace, or
multiple remote workspaces.
How is the Terraform remote backend different than other state back ends such
as S3, Consul, etc?
It can execute Terraform runs on dedicated infrastructure on premises or in Terraform
Cloud.
What is the workflow for deploying new infrastructure with Terraform?
Write a Terraform configuration, run terraform init, run terraform plan to review planned
infrastructure changes, and terraform apply to create new infrastructure.
You run a local-exec provisioner in a null resource called
null_resource.run_script and realize that you need to rerun the script. Which of
the following commands would you use first?
terraform taint null_resource.run_script
Which provisioner invokes a process on the resource created by Terraform?
remote-exec
What command does Terraform require the first time you run it within a
configuration directory?
terraform init
You have deployed a new webapp with a public IP address on a cloud provider.
However, you did not create any outputs for your code. What is the best method
to quickly find the IP address of the resource you deployed?
Run 'terraform state list' to find the names of the resource, then 'terraform state show' to
find the attributes including the public IP address.
Which of the following is not a key principle of infrastructure as code?
Golden images
Terraform variables and outputs that set the "description" argument will store
that description in the state file.
False
If you manually destroy infrastructure, what is the best practice reflecting this
change in Terraform?
Run 'terraform refresh'
What is not processed when running a terraform refresh?
Configuration file.
What information does the public Terraform Module Registry automatically
expose about published modules?
All of the above (input variables, default values, and outputs)
If a module uses a local values, you can expose that value with a terraform
output.
True
, You should store secret data in the same version control repository as your
Terraform configuration.
False
Which of the following is not a valid string function in Terraform?
Slice
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.)
1. Use 'terraform import' command for existing VMs
2. Write Terraform configuration for the existing VMs
You have recently started a new job at a retailer as an engineer. As part of this
new role, you have been tasked with evaluating multiple outages that occurred
during peak shopping time during the holiday season. Your investigation found
that the team is manually deploying new compute instances and configuring each
compute instance manually. This has led to inconsistent configuration between
each compute instance. How would you solve this using infrastructure as code?
Implement a provisioning pipeline that deploys infrastructure configurations committed
to your version control system following code reviews
Reveal Solution
terraform init initializes a sample main.tf file in the current directory.
False
Which two steps are required to provision new infrastructure in the Terraform
workflow? (Choose two.)
1. Init
2. Apply
Why would you use the terraform taint command?
When you want to force Terraform to destroy and recreate a resource on the next apply
Terraform requires the Go runtime as a prerequisite for installation.
False
When should you use the force-unlock command?
Automatic unlocking failed
Terraform can import modules from a number of sources which of the following
is not a valid source?
FTP server
Which of the following is available only in Terraform Enterprise or Cloud
workspaces and not in Terraform CLI?
Secure variable storage
terraform validate validates the syntax of Terraform files.
True
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.)