Which of the following commands would you use to access all of the attributes and details of a resource managed by Terraform?
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.
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?
What is the provider for the resource shown in the Exhibit?
resource " aws_vpc " " main " {
name = " test "
}
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
You must use different Terraform commands depending on the cloud provider you use.
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?
Terraform configuration (including any module references) can contain only one Terraform provider type.
If you don’t use the local Terraform backend, where else can Terraform save resource state?
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
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?
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 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?
A)

B)
C)
D)
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 command generates DOT (Document Template) formatted data to visualize Terraform dependencies?
What kind of configuration block will create an infrastructure object with settings specified within the block?
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?
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
The Terraform binary version and provider versions must match each other in a single configuration.
Which of the following should you add in the required_providers block to define a provider version constraint?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
It is best practice to store secret data in the same version control repository as your Terraform configuration.
You’ve updated your Terraform configuration, and you need to preview the proposed changes to your infrastructure. Which command should you run?
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?
When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
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?
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.
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
Exhibit:
variable " sizes " {
type = list(string)
description = " Valid server sizes "
default = [ " small " , " medium " , " large " ]
}
A variable declaration is shown in the exhibit. Which is the correct way to get the value of medium from this variable?
Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)
What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
A module block is shown in the Exhibit space of this page. When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?
How would you output returned values from a child module in the Terraform CLI output?
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.
You need to deploy resources into two different regions in the same Terraform configuration. To do this, you declare multiple provider configurations as shown in the Exhibit space on this page.
What meta-argument do you need to configure in a resource block to deploy the resource to the us-west-2 AWS region?
Which of the following is true about terraform apply?(Pick 2 correct responses)
Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example.
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?
If a module declares a variable with a default, that variable must also be defined within the module.
What is the Terraform style convention for indenting a nesting level compared to the one above it?
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?
Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?
Exhibit:
Root module configuration:
output " vnet_id " {
value = module.my_network.vnet_id
}
Error:
Error: Reference to undeclared output value
on main.tf line 12, in output " vnet_id " :
12: value = module.my_network.vnet_id
You are using a networking module in your Terraform configuration with the name my_network. Your root module includes the configuration shown. When you run terraform validate, you get the error shown. Which option would successfully retrieve this value from your networking module?
Your team is collaborating on infrastructure using Terraform and wants to format code to follow Terraform language style conventions. How can you update your code to meet these requirements?
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)
What functionality do providers offer in Terraform? (Pick the 3 correct responses below.)
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?
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 of the following can you do with terraform plan? (Pick 2 correct responses)
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?
You want to bring an existing database under Terraform management. What information is required to create a new import block for the database?
Pick the two correct responses below.
Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources. Which scenario presents a challenge for your team?
Infrastructure as Code (laC) can be stored in a version control system along with application code.
A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?
A Terraform output that sets the " sensitive " argument to true will not store that value in the state file.
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?