HashiCorp Terraform-Associate-004 HashiCorp Certified: Terraform Associate (004) (HCTA0-004) Exam Practice Test
Total 256 questions
HashiCorp Certified: Terraform Associate (004) (HCTA0-004) Questions and Answers
terraform validate confirms that your infrastructure matches the Terraform state file.
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)
What type of block is used to construct a collection of nested configuration blocks?
Which command does not cause Terraform to refresh its state?
terraform plan updates your state file.
The public Terraform Module Registry is free to use.
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
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?
Terraform variable names are saved in the state file.
terraform validate reports syntax check errors for which of the following?
What does state looking accomplish?
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.
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
When does Terraform create the .terraform.lock.hc1 file?
Outside of the required_providers block, Terraform configurations always refer to providers by their local names.
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
Changing the Terraform backend from the default "local" backend to a different one after performing your first terrafom apply is:
A Terraform local value can reference other Terraform local values.
Which argument can you use toprevent unexpected updatesto a module's configuration when calling Terraform Registry modules?
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.
terraform validate confirms thesyntaxof Terraform files.
Which option cannot be used to keep secrets out of Terraform configuration files?
What task does the terraform import command perform?
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 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)?
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)
Which command doesnotcause Terraform to refresh its state?
When you include a module block in your configuration that references a module from the Terraform Registry, the "version" attribute is required.
You can develop a custom provider to manage its resources using Terraform.
Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)
What does Terraform not reference when running a terraform apply -refresh-only ?
When you use a backend that requires authentication, it is best practice to:
Only the user that generated a plan may apply it.
You have to initialize a Terraform backend before it can be configured.
Module version is required to reference a module on the Terraform Module Registry.
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)
Which backend does the Terraform CLI use by default?
You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.
Now you realize that you do not actually need the load balancer, so you run terraform destroy without any flags. What will happen?
Terraform configuration can only import modules from the public registry.
While attempting to deploy resources into your cloud provider using Terraform, you begin to see some odd behavior and experience slow responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform's logging more verbose?
What is terraform plan -refresh-only intended to detect?
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?
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
Which of the following is not a valid source path for specifying a module?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
You can reference a resource created with for_each using a Splat ( *) expression.
What type of information can be found on the Terraform Registry when using published modules?
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?
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
Which of the following is true about terraform apply?(Pick 2 correct responses)
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.
A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?
Which of these are features of Terraform Cloud? Choose two correct answers.
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.
_______backends support state locking.
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.
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
How can terraform plan aid in the development process?
You can configure Terraform to log to a file using the TF_LOG environment variable.
What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
Which of the following module source paths does not specify a remote module?
It is best practice to store secret data in the same version control repository as your Terraform configuration.
What is the workflow for deploying new infrastructure with Terraform?
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
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?
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?
Which of these ate features of Terraform Cloud? Choose two correct answers.
What is a key benefit of the Terraform state file?
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?
Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?
You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.
What will happen you run terraform apply in the working directory again?
Which command must you first run before performing further Terraform operations in a working directory?
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"
}
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
Total 256 questions