terraform validate confirms that your infrastructure matches the Terraform state file.
What type of information can be found on the Terraform Registry when using published modules?
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?
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?
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
Outside of the required_providers block, Terraform configurations always refer to providers by their local names.
You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.
How will Terraform choose which version of the provider to use?
In a HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.
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?
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?
You ' re writing a Terraform configuration that needs to read input from a local file called id_rsa.pub . Which built-in Terraform function can you use to import the file ' s contents as a string?
Which parameters does the import block require? (Pick the 2 correct responses below.)
A provider configuration block is required in every Terraform configuration.
Example:

Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.
The HCP Terraform private registry keeps the module configurations confidential within your organization.
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
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?
You want to define a single input variable to capture configuration values for a server. The values must represent memory as a number, and the server name as a string.
Which variable type could you use for this input?
You ' re writing a Terraform configuration that needs to read input from a local file called id_rsa.pub. Which built-in Terraform function can you use to import the file ' s contents as a string?
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
If you don’t use the local Terraform backend, where else can Terraform save resource state?
You 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 Terraform will delete.
Which command should you use to show all the resources that will be deleted? (Pick the 2 correct responses)
Your root module contains a variable namednum_servers. Which is the correct way to pass its value to a child module with an input namedservers?
You can configure Terraform to log to a file using the TF_LOG environment variable.
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
When declaring a variable, setting the sensitive argument to true will prevent the value from being stored in the state file.
Terraform requires using a different provider for each cloud provider where you want to deploy resources.
What kind of configuration block will create an infrastructure object with settings specified within the block?
Which of the following arguments are required when declaring a Terraform output?
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
Exhibit:
resource " aws_instance " " example " {
ami = " ami-0a123456789abcdef "
instance_type = " t3.micro "
}
You are updating a child module with the resource block shown in the exhibit. The public_ip attribute of the resource needs to be accessible to the parent module. How do you meet this requirement?
Exhibit:
resource " azurerm_linux_web_app " " app " {
name = " example-app "
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
service_plan_id = azurerm_service_plan.plan.id
identity {
type = " UserAssigned "
identity_ids = [azurerm_user_assigned_identity.app.id]
}
}
resource " azurerm_role_assignment " " kv_access " {
scope = azurerm_key_vault.kv.id
role_definition_name = " Key Vault Secrets User "
principal_id = azurerm_user_assigned_identity.app.principal_id
}
Two resource blocks are shown: azurerm_linux_web_app and azurerm_role_assignment. When provisioned, the web app will use the role assignment during creation, so the role assignment must be created first. How do you ensure the azurerm_role_assignment resource is created first?
What does Terraform not reference when running a terraform apply -refresh-only ?
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?
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.)
Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources.
Which scenario presents a challenge for your team?
Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.
You want to use API tokens and other secrets within your team ' s Terraform workspaces. Where does HashiCorp recommend you store these sensitive values?
(Pick 3 correct responses)
What is the Terraform style convention for indenting a nesting level compared to the one above it?
Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.
Exhibit:
provider " aws " { region = " us-east-1 " }
provider " aws " { region = " us-west-2 " }
You need to deploy resources into two different AWS regions in the same Terraform configuration using the provider blocks shown in the exhibit. What do you need to add to the provider configuration to deploy a resource to the us-west-2 AWS region?
You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?
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?
Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example.
Git::https://example.com/vpc.git)?
You ate creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog. Which of the following provider blocks would allow you to do this?
A)

B)
C)
D)
Which command must you first run before performing further Terraform operations in a working directory?
Changing the Terraform backend from the default " local " backend to a different one after performing your first terrafom apply is:
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?
You modified your Terraform configuration to fix a typo in the resource ID by renaming it from photoes to photos. What configuration will you add to update the resource ID in state without destroying the existing resource?
Original configuration:
resource " aws_s3_bucket " " photoes " {
bucket_prefix = " images "
}
Updated configuration:
resource " aws_s3_bucket " " photos " {
bucket_prefix = " images "
}
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 correct answers.
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.
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
Which are benefits of migrating from a local state backend to a remote backend? (Pick the 2 correct responses below.)
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
B.

C.

D.

Your Terraform configuration declares a variable. You want to enforce that its value meets your specific requirements, and you want to block the Terraform operation if it does not. What should you add to your configuration?
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.
A data source is shown in the exhibit below.
How do you reference the id attribute of this data source?

}
}
Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?
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?
You are creating a reusable Terraform configuration and want to include an optional billing_dept tag so your Finance team can track team-specific spending on resources. Which of the following billing_dept variable declarations will achieve this?
Exhibit:
data " aws_ami " " web " {
most_recent = true
owners = [ " self " ]
tags = {
Name = " web-server "
}
}
A data source is shown in the exhibit. How do you reference the id attribute of this data source?
What type of block is used to construct a collection of nested configuration blocks?
Which features do HCP Terraform workspaces provide that are not available in Terraform Community Edition? (Pick the 3 correct responses below.)
terraform apply will fail if you have not run terraform plan first to update the plan output.
What feature stops multiple users from operating on the Terraform state at the same time?
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.