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?
In Terraform HCL, an object type of object({name=string, age-number}) would match this value.
A Terraform output that sets the " sensitive " argument to true will not store that value in the state file.
INcheck block ' s assertion fails, Terraform blocks the current operation from executing.
Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?
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 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)?
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?
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
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.)
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?
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?
You have a list of numbers that represents the number of free CPU cores on each virtual cluster:
numcpus = [ 18, 3, 7, 11, 2 ]
What Terraform function could you use to select the largest number from the list?
You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.
What will happen if you delete the VM using the cloud provider console, then run terraform apply again without changing any Terraform code?
Outside of the required_providers block, Terraform configurations always refer to providers by their local names.
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?
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.
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 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.
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?
Changing the Terraform backend from the default " local " backend to a different one after performing your first terrafom apply is:
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)
Which command(s) adds existing resources in a public cloud into Terraform state?
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?
What does Terraform not reference when running a terraform apply -refresh-only ?
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.
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?
The exhibit below shows part of a Terraform configuration you have been asked to update. The name of the Azure Virtual Network should be set to the name of the resource group followed by a dash and the word vnet.
Exhibit:
data " azurerm_resource_group " " example " {
name = var.resource_group_name
}
resource " azurerm_virtual_network " " example " {
name = ______________________
}
Which expression fulfills this requirement?
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.
Where does HashiCorp recommend you store API tokens and other secrets within your team’s Terraform workspaces?
Pick the three correct responses below.
You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
You provisioned virtual machines (VMs) on Google Cloud Platform using the gcloud command-line tool.
What must be done to manage these VMs using Terraform instead? Pick the two correct responses.
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
Which of these are features of Terraform Cloud? Choose two correct answers.
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?
If you don’t use the local Terraform backend, where else can Terraform save resource state?
Infrastructure as Code (laC) can be stored in a version control system along with application code.
You’ve just finished refactoring part of your Terraform workspace’s configuration to use a module to manage some of your resources. When you plan your changes, you notice that Terraform will destroy and recreate the affected resources. Doing so could cause unintended downtime in the application your workspace manages. What supported approach should you take to complete the refactor without destroying and recreating your resources?
How does the use of Infrastructure as Code (IaC) enhance the reliability of your infrastructure?
Pick the two correct responses below.
How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.
All modules published on the official Terraform Module Registry have been verified by HasihCorp.
When you use a backend that requires authentication, it is best practice to:
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?
How do you specify a module’s version when publishing it to the public terraform Module Registry?
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
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?
Module version is required to reference a module on the Terraform Module Registry.
What does this code do?
terraform { required_providers { aws = " > = 3.0 " }}
Which of the following is true about terraform apply?(Pick 2 correct responses)
Which of the following should you add in the required_providers block to define a provider version constraint?
When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)
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 of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
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 not a valid source path for specifying a module?
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 of the following can you do with terraform plan? (Pick 2 correct responses)
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?
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
You are responsible for a set of infrastructure that is managed by two workspaces: example-network and example-compute. The example-compute workspace uses data from output values configured in the example-network workspace and must be deployed afterward. Currently, this is a manual process:
An operator deploys changes to the example-network workspace.
They manually copy the output values from the example-network workspace to input variables configured for the example-compute workspace.
They deploy the example-compute workspace.
Which HCP Terraform features can you use to automate this process?
Pick the two correct responses below.
Which of the following does HCP Terraform perform during a health assessment for a workspace?
terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?
Error:
yaml
CopyEdit
Error loading state: AccessDenied: Access Denied
status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com
A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?
Which argument can you set on a module block to prevent Terraform from updating the module’s configuration during an init or get operation?
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?
By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?
You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully. What will happen if you terraform apply again immediately afterward without changing any Terraform code?
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 "
}
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
Which of the following can you do with terraform plan?
Pick the two correct responses below.
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.