Infrastructure as Code (laC) can be stored in a version control system along with application code.
When using multiple configurations of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
What is the provider for the resource shown in the Exhibit?
resource " aws_vpc " " main " {
name = " test "
}
How do you specify a module’s version when publishing it to the public terraform Module Registry?
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.
When you use a remote backend that needs authentication, HashiCorp recommends that you:
Which of the following module source paths does not specify a remote module?
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?
How does the use of Infrastructure as Code (IaC) enhance the reliability of your infrastructure?
Pick the two correct responses below.
You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:
When you run terraform validate, you get the following error:
What must you do to successfully retrieve this value from your networking module?
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?
You used Terraform to create an ephemeral development environment in the cloud 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 the resources that will be deleted? (Pick the 2 correct responses)
When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)
Which command must you run before you run a plan or apply for the first time?
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?
A Terraform output that sets the " sensitive " argument to true will not store that value in the state file.
Which of the following is not a valid source path for specifying a module?
Which command(s) adds existing resources in a public cloud into Terraform state?
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?
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)
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.
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
It is best practice to store secret data in the same version control repository as your Terraform configuration.
You have developed a new cloud-based service that uses proprietary APIs and want to use Terraform to create, manage, and delete users from the service. How can Terraform interact with the service?
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.
You can configure multiple cloud blocks in your Terraform configuration to connect your workspace to both HCP Terraform and your Terraform Enterprise instance.
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?
The_________determines how Terraform creates, updates, or delete resources.
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.

The Terraform configuration shown in the Exhibit space on this page v/ill create a new AWS instance.
Which of the following should you add in the required_providers block to define a provider version constraint?
How would you output returned values from a child module in the Terraform CLI output?
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)?
Which method for sharing Terraform modules fulfills the following criteria:
Keeps the module configurations confidential within your organization.
Supports Terraform ' s semantic version constraints.
Provides a browsable directory of your modules.
You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?
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?
You have set the TF_LOG_PATH environment variable for Terraform, and you would like to ensure the logs contain all debug-level messages and verbose process logs.
Which action should you take?
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)
When a check block’s assertion fails, Terraform blocks the current operation from executing.
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
terraform validate uses provider APIs to verify your infrastructure settings.
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?
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
You can access state stored with the local backend by using terraform_remote_state data source.
When you use a backend that requires authentication, it is best practice to:
You are updating a child module with the resource block shown in the exhibit below. The public_ip attribute of the resource needs to be accessible to the parent module.
Exhibit:
resource " aws_instance " " example " {
ami = " ami-0a123456789abcdef "
instance_type = " t3.micro "
}
How do you meet this requirement?
Which of the following commands would you use to access all of the attributes and details of a resource managed by 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?
Which option cannot be used to keep secrets out of Terraform configuration files?
You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.
A Terraform backend determines how Terraform loads state and stores updates when you execute which command?
Which of the following can you do with terraform plan? (Pick 2 correct responses)
You can configure Terraform to log to a file using the TF_LOG environment variable.
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?
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
When you include a module block in your configuration that references a module from the Terraform Registry, the " version " attribute is required.
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 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?
Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.
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?
Running terraform fmt without any flags in a directory with Terraform configuration files will check the formatting of those files, but will never change their contents.
Does terraform init create an example main.tf file in the current directory?
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?
What does Terraform not reference when running a terraform apply -refresh-only ?
Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?
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?
One remote backend configuration always maps to a single remote workspace.
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)
What is the Terraform style convention for indenting a nesting level compared to the one above it?
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?
Your team is using version 3.1.4 of a module from the public Terraform Registry, and they are worried about possible breaking changes in future versions of the module. Which version argument should you add to the module block to prevent newer versions from being used?
What functionality do providers offer in Terraform? (Pick the 3 correct responses below.)
What type of information can be found on the Terraform Registry when using published modules?
Which of the following can you do with terraform plan?
Pick the two correct responses below.
Which are forbidden actions when the terraform state file is locked? Choose three correct answers.
What information does the public Terraform Module Registry automatically expose about published 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.
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of that resource block?