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.
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?
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?
Which statements are true about terraform apply? (Choose TWO correct answers)
Which parameters does the import block require? (Pick the 2 correct responses below.)
Define the purpose of state in Terraform.
When a check block’s assertion fails, Terraform blocks the current operation from executing.
You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.
Which Terraform command should you runfirst?
_______backends support state locking.
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.
When should you use the force-unlock command?
Which of the following is not a valid source path for specifying a module?
Which is not a benefit of adopting IaC (Infrastructure as Code)?
Terraform providers are always installed from the Internet.
Which of the following can you do with terraform plan?
Pick the two correct responses below.
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?
Which of the following is not a benefit of adopting infrastructure as code?
You much initialize your working directory before running terraform validate.
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?
After creating a new Terraform configuration, your configuration passes terraform validate but returns an “Access Denied” error from the cloud provider when running terraform plan.
Why did terraform validate not catch this issue?
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.)
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
Which parameters does terraform import require? Choose two correct answers.
Terraform variable names are saved in the state file.
What is a key benefit of the Terraform state file?
What is one disadvantage of using dynamic blocks in Terraform?
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?
Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)
Where in your Terraform configuration do you specify remote state storage settings?
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of that resource block?
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 correct answers.
Which command(s) adds existing resources in a public cloud into Terraform state?
You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?
Using the terraform state rm command against a resource will destroy it.
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?
How can you configure a Terraform workspace to store its state remotely?
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?
You want to create a string that combines 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?
terraform validate uses provider APIs to verify your infrastructure settings.
Which option cannot be used to keep secrets out of Terraform configuration files?

A resource block is shown in the Exhibit space of this page. What is the provider for this resource?
In Terraform HCL, an object type of object({name=string, age-number}) would match this value.

When do changes invoked by terraform apply take effect?
Where does HashiCorp recommend you store API tokens and other secrets within your team ' s Terraform workspaces?
Pick three correct responses below:
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
Terraform providers are part of the Terraform core binary.
terraform init retrieves and caches the configuration for all remote modules.
When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.
Which of these workflows is only enabled by the use of Infrastructure as Code?
Which of the following is true about terraform apply?(Pick 2 correct responses)
Select the command that doesn’t cause Terraform to refresh its state.
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?
Which of the following are advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
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 command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
When should you run terraform init?
A developer launched a VM outside of the Terraform workflow and ended up with two servers with the same name. They are unsure which VM is managed with Terraform, but they do have a list of all active VM IDs. Which method could you use to determine which instance Terraform manages?
What is the workflow for deploying new infrastructure with Terraform?
What is the primary purpose of Infrastructure as Code (IaC)?
You have used Terraform lo create an ephemeral development environment in the (loud 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 of the resources that mil be deleted? Choose two correct answers.
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.
You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
You cannot install third party plugins using terraform init.
How can you enable verbose logging to troubleshoot Terraform?
Exhibit:
module " web_stack " {
source = " ./modules/web_stack "
}
Your configuration defines the module block shown in the exhibit. The web_stack module accepts an input variable named servers. Which of the following changes to the module block sets the servers variable to the value of 3?
When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)
Which argument can you set on a module block to prevent Terraform from updating the module’s configuration during an init or get operation?
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?
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
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?
Why would you use the -replace flag for terraform apply?
What functionality do providers offer in Terraform?(Pick 3 correct responses)
terraform destroy is the only way to remove infrastructure.
A Terraform backend determines how Terraform loads state and stores updates when you execute which command?
All modules published on the official Terraform Module Registry have been verified by HasihCorp.
You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running the command terraform apply my.tfplan, you receive the error shown in the exhibit below.
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.
How can you apply the desired changes? (Choose TWO correct answers)
Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example.
A module can always refer to all variables declared in its parent module.
terraform validate reports syntax check errors for which of the following?
Which of the following is not an action performed by terraform init?
What is an advantage of immutable infrastructure?
Terraform requires using a different provider for each cloud provider where you want to deploy resources.
What does Terraform not reference when running a terraform apply -refresh-only ?
What is the provider for the resource shown in the Exhibit?
resource " aws_vpc " " main " {
name = " test "
}
Which of the following commands would you use to access all of the attributes and details of a resource managed by Terraform?
A Terraform provider is NOT responsible for:
What type of block is used to construct a collection of nested configuration blocks?
Which provider authentication method prevents credentials from being stored in the state file?
You need to determine from which paths Terraform is loading the providers referenced in your *.tf files.
How can you enable additional logging to see this information?
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?
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource " main ' .
Which of these is the correct way to define the output value?
When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?
The public Terraform Module Registry is free to use.
One remote backend configuration always maps to a single remote workspace.
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
Your team uses HCP Terraform to manage infrastructure. You need to make a change to an infrastructure stack running in a public cloud. Which pattern follows Infrastructure as Code best practices for making the change?
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?
Which is a benefit of the Terraform state file?
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
The_________determines how Terraform creates, updates, or delete resources.
In a Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
Which command lets you experiment with terraform expressions?
Why is it considered important to treat your Terraform state file as sensitive?
Terraform configuration can only call modules from the public registry.
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?
Which are benefits of migrating from a local state backend to a remote backend? (Pick the 2 correct responses below.)