Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?
Your configuration contains a module block that references a module from the Terraform Registry and sets the version argument to 1.0. You just published a new version of the module and updated your configuration to point to version 1.1.
Which command must be run to install the new version?
A Terraform output that sets the " sensitive " argument to true will not store that value in the state file.
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
You have successfully deployed an application that includes a resource with a public IP address. Due to a configuration oversight, no outputs were defined.
Using the Terraform CLI, how can you find the IP address of the deployed resource with minimum disruption to the application?
Which Terraform command checks that your configuration syntax is correct?
What’s the proper syntax for the plan command?
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
You ' ve used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?
When a check block’s assertion fails, Terraform blocks the current operation from executing.
Terraform providers are part of the Terraform core binary.
You have just upgraded the version constraint of a provider in an existing Terraform configuration. What command will install the new provider version?
Which argument can you use toprevent unexpected updatesto a module ' s configuration when calling Terraform Registry modules?
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
terraform init retrieves and caches the configuration for all remote modules.
What is one disadvantage of using dynamic blocks in Terraform?
When do you need to explicitly execute Terraform in refresh-only mode?
terraform validate confirms thesyntaxof Terraform files.
Which of the following is not true of Terraform providers?
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.
Terraform variable names are saved in the state file.
terraform validate confirms that your infrastructure matches the Terraform state file.
Terraform stores the value of an output in its state file, even if the sensitive argument is set to true.
Which of the following is not a key principle of infrastructure as code?
terraform destroy is the only way to remove infrastructure.
What does the default " local " Terraform backend store?
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.)
A module can always refer to all variables declared in its parent module.
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
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?

You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
A developer on your team is going to leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?
Where can Terraform not load a provider from?
Which argument can you set on a module block to prevent Terraform from updating the module’s configuration during an init or get operation?
Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources.
Which scenario presents a challenge for your team?
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.
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
What functionality do providers offer in Terraform? (Pick the 3 correct responses below.)
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?
What is the purpose of the terraform.lock.hcl file in Terraform?
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?
Which command doesnotcause Terraform to refresh its state?
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?
A Terraform local value can reference other Terraform local values.
Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.
The terraform output command shows outputs from child modules.
Which features do HCP Terraform workspaces provide that are not available in Terraform Community Edition? (Pick the 3 correct responses below.)
When does Terraform create the .terraform.lock.hc1 file?
What is an advantage of immutable infrastructure?
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?
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.
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?
Which of the following does HCP Terraform perform during a health assessment for a workspace?
Pick the 2 correct responses below:
Which of the following should you add in the required_providers block to define a provider version constraint?
Which option does not keep secret variable values out of Terraform configuration files?
You can execute terraform fmt to standardize all Terraform configurations within the current working directory to Terraform’s canonical format and style.
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
What feature stops multiple users from operating on the Terraform state at the same time?
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?
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
Which statements are true? Choose two correct answers.
Which command must you first run before performing further Terraform operations in a working directory?
How do you specify a module’s version when publishing it to the public terraform Module Registry?
What is the Terraform style convention for indenting a nesting level compared to the one above it?
What is terraform plan -refresh-only intended to detect?
When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.
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.
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?
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?
Which are forbidden actions when the terraform state file is locked? Choose three correct answers.
Which command add existing resources into Terraform state?
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 statements are true about terraform apply? (Choose TWO correct answers)
When using multiple configurations of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
terraform validate uses provider APIs to verify your infrastructure settings.
Which option cannot be used to keep secrets out of Terraform configuration files?
When does Sentinel enforce policy logic during a Terraform Cloud run?
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 the import block do?
When you initialize Terraform, where does it cache modules from the public Terraform Registry?
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?
You much initialize your working directory before running terraform validate.
Parent modules can always access a child module’s variable values.
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?
Your team often uses API calls to create and manage cloud infrastructure. In what ways does Terraform differ from conventional infrastructure management approaches?
Which of these is stored in the .terraform directory?
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 situation will return an error when you run 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?
Which backend does the Terraform CLI use by default?
Which of the following is not an action performed by terraform init?
Which are examples of infrastructure as code? Choose two correct answers.
terraform init creates an example main.tf file in the current directory.
You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After application changes, you updated the Terraform code to change the port to 443.
You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended and step away to grab some coffee.
In the meantime, another team member manually changes the load balancer port to 443 through the cloud provider console before you get back to your desk.
What will happen when you run terraform apply upon returning to your desk?
Does terraform init create an example main.tf file in the current directory?
Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention.
How should they ensure the code satisfies conventions?
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
Which of the following should you put into the required_providers block?
Your Terraform configuration manages a resource that requires maximum uptime. You need to update the resource, and when you run terraform plan, Terraform indicates that the update requires the resource to be destroyed and recreated.
Which lifecycle rule can you add to the resource to reduce downtime while still applying the update?
Which of these is true about Terraform ' s plugin-based architecture?
You have to initialize a Terraform backend before it can be configured.
You can install community and partner plugins using terraform init.
Outside of the required_providers block, Terraform configurations always refer to providers by their local names.
Why would you use the -replace flag for terraform apply?
You just scaled your VM infrastructure and realize you set the count variable to the wrong value. You correct the value and save your change. What must you do next to make your infrastructure match your configuration?
What is the primary purpose of Infrastructure as Code (IaC)?
You’ve updated your Terraform configuration, and you need to preview the proposed changes to your infrastructure. Which command should you run?
What is the workflow for deploying new infrastructure with Terraform?
Which command(s) adds existing resources in a public cloud into Terraform state?
Terraformrequiresthe Go runtime as a prerequisite for installation.
You manage two workspaces in your HCP Terraform organization. The first workspace manages your network configuration. The second workspace manages your compute resources and retrieves values from the networking workspace.
What HCP Terraform feature lets you run an apply operation on the compute workspace every time you update the networking workspace?
Which statement describes a goal of Infrastructure as Code (IaC)?
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?