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?
A provider configuration block is required in every Terraform configuration.
Example:

When you use a remote backend that needs authentication, HashiCorp recommends that you:
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of that resource block?
Your team often uses API calls to create and manage cloud infrastructure. In what ways does Terraform differ from conventional infrastructure management approaches?
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 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 of the following should you add in the required_providers block to define a provider version constraint?
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:
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?
All modules published on the official Terraform Module Registry have been verified by HasihCorp.
Which of the following should you add in the required_providers block to define a provider version constraint?
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.
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?
How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.
What is the name of the default file where Terraform stores the state?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
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 of these statements about HCP Terraform/Terraform Cloud workspaces is false?
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.
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?
When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
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?
What kind of configuration block will create an infrastructure object with settings specified within the block?
One cloud block always maps to a single HCP Terraform/Terraform Cloud workspace.
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?
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?
Which parameters does the import block require? (Pick the 2 correct responses below.)
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?
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
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?
When using multiple configurations of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
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?
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
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 the 3 correct responses)
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.
You can configure Terraform to log to a file using the TF_LOG environment variable.
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?
What is the provider for the resource shown in the Exhibit?
resource " aws_vpc " " main " {
name = " test "
}
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.
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?
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?
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.
Which is a benefit of using infrastructure as code (IaC) tools compared to native platform APIs?
What kind of configuration block will manage an infrastructure object with settings specified within the block?
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
You corrected a typo in a resource name, changing it from aws_s3_bucket.photoes to aws_s3_bucket.photos. You want to update the Terraform state so that the existing resource is recognized under the new name, without destroying and recreating it. Which configuration should you use?
You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?
Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
Which of the following arguments are required when declaring a Terraform output?
Which of the following can you do with terraform plan?
Pick the two correct responses below.
Which two steps are required to provision new infrastructure in the Terraform workflow? (Pick the 2 correct responses below.)
You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.