A Terraform configuration returns errors when you run terraform plan. How would you enable debug logging to investigate further?
One cloud block always maps to a single HCP Terraform/Terraform Cloud workspace.
Which statement describes a goal of Infrastructure as Code (IaC)?
What is modified when executing Terraform inrefresh-only mode?
A provider configuration block is required in every Terraform configuration.
Example:
Module version is required to reference a module on the Terraform Module Registry.
What does terraform destroy do?
You ' re building a CI/CD (continuous integration/continuous delivery) pipeline and need to inject sensitive variables into your Terraform run. How can you do this safely?
You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?
You want to bring an existing database under Terraform management. What information is required to create a new import block for the database?
Pick the two correct responses below.
What type of block is used to construct a collection of nested configuration blocks?
A Terraform provider is NOT responsible for:
A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?
Which option does not keep secret variable values out of Terraform configuration files?
Module variable assignments are inherited from the parent module and you do not need to explicitly set them.
You need to deploy resources into two different regions in the same Terraform configuration using the block shown in the exhibit below.
What do you need to add to the provider configuration to deploy the resource to the us-west-2 AWS region?
A data source is shown in the exhibit below.
How do you reference the id attribute of this data source?
}
}
Which of these workflows is only enabled by the use of Infrastructure as Code?
How does Terraform manage most dependencies between resources?
Terraform providers are always installed from the Internet.
How could you reference an attribute from the vsphere_datacenter data source for use with the datacenter_id argument within the vsphere_folder resource in the following configuration?
When should you use the terraform force-unlock command?
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
Terraform requires using a different provider for each cloud provider where you want to deploy resources.
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
Which command must you first run before performing further Terraform operations in a working directory?
You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?
You have a list of numbers representing the number of free CPU cores on each virtual cluster:
numcpus = [18, 3, 7, 11, 2]
Which Terraform built-in function would you use to select the largest number from the list?
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
Any user can publish modules to the public Terraform Module Registry.
Which are advantages of IaC (Infrastructure as Code) patterns instead of manual infrastructure management?
Pick the 2 correct responses below.
How does Terraform determine dependencies between resources?
Exhibit:
Root module configuration:
output " vnet_id " {
value = module.my_network.vnet_id
}
Error:
Error: Reference to undeclared output value
on main.tf line 12, in output " vnet_id " :
12: value = module.my_network.vnet_id
You are using a networking module in your Terraform configuration with the name my_network. Your root module includes the configuration shown. When you run terraform validate, you get the error shown. Which option would successfully retrieve this value from your networking module?
What does terraform import do?
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
While attempting to deploy resources into your cloud provider using Terraform, you begin to see some odd behavior and experience slow responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform ' s logging more verbose?
When a check block’s assertion fails, Terraform blocks the current operation from executing.
When does Sentinel enforce policy logic during a Terraform Cloud run?
Exhibit:
data " vsphere_datacenter " " dc " {}
resource " vsphere_folder " " parent " {
path = " Production "
type = " vm "
datacenter_id = _________
}
You want to pass the id of the vsphere_datacenter data source to the datacenter_id argument of the vsphere_folder resource. Which reference would you use?
You are tasked with making a change to an infrastructure stack running in a public cloud using HCP Terraform/Terraform Cloud. Which pattern follows IaC best practices?
Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of that resource block?
Which are examples of infrastructure as code? Choose two correct answers.
You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.
What will happen you run terraform apply in the working directory again?
What does Terraform use to deploy infrastructure for different cloud providers?
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?
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)
You can install community and partner plugins using terraform init.
What is the purpose of the terraform.lock.hcl file in Terraform?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
Terraform variables and outputs that set the description argument will store that description in the state file.
Which of these is stored in the .terraform directory?
If one of your modules uses a local value, you can expose that value to callers of the module by defining a Terraform output in the module’s configuration.
Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.
A child module can always access variables declared in its parent module.
What does this code do?
terraform { required_providers { aws = " > = 3.0 " }}
What is terraform plan -refresh-only intended to detect?
Your team is using version 3.1.4 of a module from the public Terraform Registry, and they are worried about possible breaking changes in future versions of the module. Which version argument should you add to the module block to prevent newer versions from being used?
You modified your Terraform configuration and run Terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.
A resource block is shown in the Exhibit space of this page. How would you reference the name value of the second instance of this resource?
How is terraform import run?
Which command lets you experiment with terraform expressions?
What is the provider for this resource?
Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources.
Which scenario presents a challenge for your team?
Terraformrequiresthe Go runtime as a prerequisite for installation.
Why does this backend configuration not follow best practices?

You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.
Now you realize that you do not actually need the load balancer, so you run terraform destroy without any flags. What will happen?
If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.
You’ve enabled DEBUG-level logging for Terraform, and you’d like to send the log data to a file. Which action should you take?
Does terraform init create an example main.tf file in the current directory?
terraform init retrieves and caches the configuration for all remote modules.
You need to destroy all of the resources in your Terraform workspace, except for aws_instance.ubuntu[1], which you want to keep. How can you tell Terraform to stop managing that specific resource without destroying it?
Exhibit:
resource " kubernetes_namespace " " example " {
name = " test "
}
A resource block is shown in the exhibit. How would you reference the name attribute of this resource in HCL?
Which option cannot be used to keep secrets out of Terraform configuration files?
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
Exhibit:
module " network " {
source = " terraform-google-modules/network/google "
version = " ~ > 11.0 "
}
What version of the source module does Terraform allow with the module block shown in the exhibit?
You’ve updated your Terraform configuration, and you need to preview the proposed changes to your infrastructure. Which command should you run?
Terraform configuration can only call modules from the public registry.
Terraform configuration can only import modules from the public registry.
terraform init creates an example main.tf file in the current directory.
You want to create a string that is a combination of a generated random_id and a variable, and reuse that string several times in your configuration.
What is the simplest correct way to implement this without repeating the random_id and variable?
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Cloud automatically and proactively enforce this security control?
Which method for sharing Terraform configurations fulfills the following criteria:
1. Keeps the configurations confidential within your organization
2. Support Terraform’s semantic version constrains
3. Provides a browsable directory
What does the import block do?
terraform destroy is the only way to remove infrastructure with Terraform.
How can terraform plan aid in the development process?
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
What is the purpose of the .terraform directory in a Terraform workspace?
What’s the proper syntax for the plan command?
Your team is collaborating on infrastructure using Terraform and wants to format code to follow Terraform language style conventions. How can you update your code to meet these requirements?
What does Terraform use the .terraform.lock.hc1 file for?
You have a simple Terraform configuration containing one VM (virtual machine) in a cloud provider. You run terraform apply and the VM is created successfully. What will happen if you run terraform apply again immediately afterwards without changing any Terraform code?
Which of the following is not a key principle of infrastructure as code?
As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?
When you use a backend that requires authentication, it is best practice to:
terraform destroy is the only way to remove infrastructure.
What is the primary purpose of Infrastructure as Code (IaC)?
What feature stops multiple users from operating on the Terraform state at the same time?
Exhibit:
Error: Saved plan is stale
The given plan file can no longer be applied because the state was changed by another operation after the plan was created.
You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running terraform apply my.tfplan, you receive the error shown. How can you apply the desired changes? (Pick the 2 correct responses below.)
Only the user that generated a terraform plan may apply it.
Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
Which of these commands makes your code more human readable?
terraform validate confirms the syntax of Terraform configuration files.
In Terraform HCL, an object type of object({name=string, age-number}) would match this value.

You have developed a new cloud-based service that uses proprietary APIs and want to use Terraform to create, manage, and delete users from the service. How can Terraform interact with the service?
Part of a configuration is shown in the exhibit below.
You want to pass the id of the vsphere_datacenter data source to the datacenter_id argument of the vsphere_folder resource.
Which reference would you use?
How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?

Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
What functionality do providers offer in Terraform? (Pick the 3 correct responses below.)
When declaring a variable, setting the sensitive argument to true will prevent the value from being stored in the state file.
You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:
When you run terraform validate, you get the following error:
What must you do to successfully retrieve this value from your networking module?