HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Questions and Answers
terraform plan updates your state file.
Terraform encrypts sensitive values stored in your state file.
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
Which of these ate features of Terraform Cloud? Choose two correct answers.
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 is the provider for the resource shown in the Exhibit?
resource "aws_vpc" "main" {
name = "test"
}
What feature stops multiple users from operating on the Terraform state at the same time?
Which of the following is not a valid Terraform collection type?
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 should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
You can develop a custom provider to manage its resources using Terraform.
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?
The Terraform binary version and provider versions must match each other in a single configuration.
Variables declared within a module are accessible outside of the module.
Terraform variables and outputs that set the description argument will store that description in the state file.
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?
A terraform apply can not _________ infrastructure.
Which are forbidden actions when the terraform state file is locked? Choose three correct answers.
What does Terraform use the .terraform.lock.hc1 file for?
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
When do you need to explicitly execute Terraform in refresh-only mode?
Where does the Terraform local backend store its state?
A developer on your team is going lo 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?
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
Terraform configuration (including any module references) can contain only one Terraform provider type.
Which of the following is not a key principle of infrastructure as code?
Terraform configuration can only import modules from the public registry.
How do you specify a module’s version when publishing it to the public terraform Module Registry?
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.
When do changes invoked by terraform apply take effect?
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
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?
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?
Define the purpose of state in Terraform.
What is a key benefit of the Terraform state file?
You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.
How would you output returned values from a child module in the Terraform CLI output?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
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.
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
How does Terraform determine dependencies between resources?
Before you can use a remote backend, you must first execute terra-form init.
terraform destroy is the only way to remove infrastructure.
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?
You have to initialize a Terraform backend before it can be configured.
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
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?
When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
Which Terraform command checks that your configuration syntax is correct?
What is modified when executing Terraform inrefresh-only mode?
You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?
When does Sentinel enforce policy logic during a Terraform Cloud run?
What is one disadvantage of using dynamic blocks in Terraform?
Which of the following is not a valid source path for specifying a module?
A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?
Which of the following is not a way to trigger terraform destroy?
Module variable assignments are inherited from the parent module and you do not need to explicitly set them.
You have used Terraform lo create an ephemeral development environment in the (loud 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 of the resources that mil be deleted? Choose two correct answers.
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)
You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?
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 command(s) adds existing resources in a public cloud into Terraform state?
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?