You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.
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 Terraform style convention for indenting a nesting level compared to the one above it?
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
Which argument can you use toprevent unexpected updatesto a module ' s configuration when calling Terraform Registry modules?
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 can access state stored with the local backend by using terraform_remote_state data source.
You can configure Terraform to log to a file using the TF_LOG environment variable.
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
Which features do HCP Terraform workspaces provide that are not available in Terraform Community Edition? (Pick the 3 correct responses below.)
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?
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.
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
Infrastructure as Code (laC) can be stored in a version control system along with application code.
Which are forbidden actions when the terraform state file is locked? Choose three correct answers.
A Terraform backend determines how Terraform loads state and stores updates when you execute which command?
When you include a module block in your configuration that references a module from the Terraform Registry, the " version " attribute is required.
How do you specify a module’s version when publishing it to the public terraform Module Registry?
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
What is the Terraform style convention for indenting a nesting level compared to the one above it?
It is best practice to store secret data in the same version control repository as your Terraform configuration.
Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.
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)?
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.
What feature stops multiple users from operating on the Terraform state at the same time?
What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.
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?
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 "
}
Terraform configuration (including any module references) can contain only one Terraform provider type.
You can reference a resource created with for_each using a Splat ( *) expression.
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
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?
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?
Which of the following locations can Terraform use as aprivate sourcefor modules?(Pick 2 correct responses)
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.
Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.
How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?

You must use different Terraform commands depending on the cloud provider you use.
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?
How would you output returned values from a child module in the Terraform CLI output?
If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resoruces, which of the following scenarios poses a challenge for this team?
Which two steps are required to provision new infrastructure in the Terraform workflow? (Pick the 2 correct responses below.)
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?
Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources. Which scenario presents a challenge for your team?
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?
Which parameters does the import block require? (Pick the 2 correct responses below.)
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?
Terraform requires using a different provider for each cloud provider where you want to deploy resources.
Which of the following commands would you use to access all of the attributes and details of a resource managed by Terraform?
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 argument can you set on a module block to prevent Terraform from updating the module’s configuration during an init or get operation?
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?
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)
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?
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?