HashiCorp Terraform-Associate-003 HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Exam Practice Test
Total 253 questions
HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Questions and Answers
Where does the Terraform local backend store its state?
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
What is a Terraform provider not responsible for?
Where in your Terraform configuration do you specify a state backend?
Which option cannot be used to keep secrets out of Terraform configuration files?
When you use a backend that requires authentication, it is best practice to:
Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
Terraform providers are always installed from the Internet.
terraform validate reports syntax check errors for which of the following?
You have to initialize a Terraform backend before it can be configured.
What does this code do?
terraform { required_providers { aws = ">= 3.0" }}
Terraform variable names are saved in the state file.
You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

Which command will migrate your current state file to the new S3 remote backend?
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
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?
Which of the following is not a valid Terraform collection type?
What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
It is best practice to store secret data in the same version control repository as your Terraform configuration.
When do you need to explicitly execute Terraform in refresh-only mode?
terraform validate uses provider APIs to verify your infrastructure settings.
Which of the following can you do with terraform plan? (Pick 2 correct responses)
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
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(s) adds existing resources in a public cloud into Terraform state?
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?
terraform apply will fail if you have not run terraform plan first to update the plan output.
Before you can use a remote backend, you must first execute terra-form init.
What is the Terraform style convention for indenting a nesting level compared to the one above it?
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
Which command lets you experiment with terraform expressions?
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
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.
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
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?
Only the user that generated a terraform plan may apply it.
Which of the following arguments are required when declaring a Terraform output?
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?
What does the default "local" Terraform backend store?
What is the workflow for deploying new infrastructure with Terraform?
Which of the following is not a benefit of adopting infrastructure as code?
You can access state stored with the local backend by using terraform_remote_state data source.
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)?
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?
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?
A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?
Using the terraform state rm command against a resource will destroy it.
terraform destroy is the only way to remove infrastructure.
When do changes invoked by terraform apply take effect?
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
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 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 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?
When does Sentinel enforce policy logic during a Terraform Cloud run?
Which of the following should you add in the required_providers block to define a provider version constraint?
How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.
You much initialize your working directory before running terraform validate.
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?
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.
What kind of configuration block will create an infrastructure object with settings specified within the block?
When you use a remote backend that needs authentication, HashiCorp recommends that you:
Any user can publish modules to the public Terraform Module Registry.
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
One cloud block always maps to a single HCP Terraform/Terraform Cloud workspace.
Which of these ate features of Terraform Cloud? Choose two correct answers.
Which command must you first run before performing further Terraform operations in a working directory?
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?
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
Where can Terraform not load a provider from?
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?
What functionality do providers offer in Terraform?(Pick 3 correct responses)
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
Total 253 questions