Prepare Important Exam with TA-002-P Exam Dumps(2025) [Q38-Q63]

Share

Prepare Important Exam with TA-002-P Exam Dumps(2025) 

Pass Exam Questions Efficiently With TA-002-P Questions


HashiCorp TA-002-P: HashiCorp Certified: Terraform Associate is a certification exam that validates the skills and knowledge of IT professionals in using Terraform. Terraform is a tool used for building, changing, and versioning infrastructure safely and efficiently. TA-002-P exam is designed for individuals who are looking to enhance their expertise in using Terraform to manage infrastructure as code efficiently.

 

NEW QUESTION # 38
A provider configuration block is required in every Terraform configuration.
Example:

  • A. True
  • B. False

Answer: A

Explanation:
Reference: https://github.com/hashicorp/terraform/issues/17928


NEW QUESTION # 39
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

  • A. Manually update the state fire
  • B. Run terraform refresh
  • C. Run terraform import
  • D. It will happen automatically

Answer: B

Explanation:
Explanation
https://www.terraform.io/cli/commands/refresh#:~:text=The%20terraform%20refresh%20command%20reads%2


NEW QUESTION # 40
What does the default "local" Terraform backend store?

  • A. Terraform binary
  • B. tfplan files
  • C. State file
  • D. Provider plugins

Answer: C

Explanation:
Explanation
The local backend stores state on the local filesystem, locks that state using system APIs, and performs
operations locally.
Reference: https://www.terraform.io/docs/language/settings/backends/local.html


NEW QUESTION # 41
When multiple engineers start deploying infrastructure using the same state file, what is a feature of remote state storage that is critical to ensure the state doesn't become corrupt?

  • A. Object Storage
  • B. Encryption
  • C. State Locking
  • D. WorkSpaces

Answer: C

Explanation:
Explanation
If supported by your backend, Terraform will lock your state for all operations that could write state. This prevents others from acquiring the lock and potentially corrupting your state.
State locking happens automatically on all operations that could write state. You won't see any message that it is happening. If state locking fails, Terraform will not continue. You can disable state locking for most commands with the -lock flag but it is not recommended.
If acquiring the lock is taking longer than expected, Terraform will output a status message. If Terraform doesn't output a message, state locking is still occurring if your backend supports it.
Not all backends support locking. Please view the list of backend types for details on whether a backend supports locking or not.
https://www.terraform.io/docs/state/locking.html


NEW QUESTION # 42
During a terraform plan, a resource is successfully created but eventually fails during provisioning. What happens to the resource?

  • A. Terraform attempts to provision the resource up to three times before exiting with an error
  • B. it is automatically deleted
  • C. the resource is marked as tainted
  • D. the terraform plan is rolled back and all provisioned resources are removed

Answer: C

Explanation:
Explanation
If a resource successfully creates but fails during provisioning, Terraform will error and mark the resource as "tainted". A resource that is tainted has been physically created, but can't be considered safe to use since provisioning failed. Terraform also does not automatically roll back and destroy the resource during the apply when the failure happens, because that would go against the execution plan: the execution plan would've said a resource will be created, but does not say it will ever be deleted.


NEW QUESTION # 43
A user creates three workspaces from the command line - prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?

  • A. terraform workspace switch dev
  • B. terraform workspace select dev
  • C. terraform workspace -switch dev
  • D. terraform workspace dev

Answer: B

Explanation:
Explanation
The terraform workspace select command is used to choose a different workspace to use for further operations.
https://www.terraform.io/docs/commands/workspace/select.html


NEW QUESTION # 44
Which flag would you add to terraform plan to save the execution plan to a file?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Answer:

Explanation:
outFILENAME


NEW QUESTION # 45
Resources in terraform can have same identifiers(Resource type + Block name).

  • A. False
  • B. True

Answer: A


NEW QUESTION # 46
You have a Terraform configuration file where a variable itemNum is defined as follows:
variable "itemNum" { default = 3}
You also have a defined the following environment variables in your shell: TF_itemNum =6, TF_VAR_itemNum =9. You also have a terraform.tfvars file with the following contents itemNum = 7 When you run the following apply command, what is the value assigned to the itemNum variable?
terraform apply -var itemNum =4

  • A. 0
  • B. 1
  • C. 2
  • D. 3
  • E. 4

Answer: E

Explanation:
The -var and -var-file methods of assigning variables have the highest precedence.
https://www.terraform.io/docs/configuration/variables.html


NEW QUESTION # 47
lookup retrieves the value of a single element from which of the below data type?

  • A. string
  • B. set
  • C. list
  • D. map

Answer: D

Explanation:
Explanation
https://www.terraform.io/docs/configuration/functions/lookup.html


NEW QUESTION # 48
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?

  • A. Terraform get provider_type_name
  • B. Terraform state list
  • C. Terraform state list provider_type_name
  • D. Terraform state show ' provider_type_name

Answer: D

Explanation:
This is the command that you would use to access all of the attributes and details of a resource managed by Terraform, by providing the resource address as an argument. For example, terraform state show 'aws_instance.example' will show you all the information about the AWS instance named example.


NEW QUESTION # 49
As a member of the operations team, you need to run a script on a virtual machine created by Terraform.
Which provisioned is best to use in your Terraform code?

  • A. null-exec
  • B. file
  • C. remote-exec
  • D. local-exec

Answer: C

Explanation:
Explanation
https://www.terraform.io/language/resources/provisioners/remote-exec


NEW QUESTION # 50
Which of the following state management command allow you to retrieve a list of resources that are part of the
state file?

  • A. terraform state view
  • B. terraform list
  • C. terraform state list
  • D. terraform view

Answer: C

Explanation:
Explanation
The terraform state list command is used to list resources within a Terraform state.
Usage: terraform state list [options] [address...]
The command will list all resources in the state file matching the given addresses (if any). If no addresses are
given, all resources are listed.
https://www.terraform.io/docs/commands/state/list.html


NEW QUESTION # 51
Terraform provisioners that require authentication can use the ______ block.

  • A. secrets
  • B. ssh
  • C. connection
  • D. credentials

Answer: C

Explanation:
Explanation
https://www.terraform.io/language/resources/provisioners/connection
"Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection
block with details about how to connect." "Connection blocks don't take a block label and can be nested within
either a resource or a provisioner."


NEW QUESTION # 52
What information does the public Terraform Module Registry automatically expose about published modules?

  • A. Outputs
  • B. None of the above
  • C. All of the above
  • D. Required input variables
  • E. Optional inputs variables and default values

Answer: B

Explanation:
Reference: https://www.terraform.io/docs/registry/modules/publish.html


NEW QUESTION # 53
You have to initialize a Terraform backend before it can be configured.

  • A. True
  • B. False

Answer: A


NEW QUESTION # 54
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?

  • A. Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces
  • B. Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
  • C. Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
  • D. Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces

Answer: C


NEW QUESTION # 55
What information does the public Terraform Module Registry automatically expose about published modules?

  • A. Outputs
  • B. None of the above
  • C. All of the above
  • D. Required input variables
  • E. Optional inputs variables and default values

Answer: C

Explanation:
The public Terraform Module Registry automatically exposes all the information about published modules, including required input variables, optional input variables and default values, and outputs. This helps users to understand how to use and configure the modules.


NEW QUESTION # 56
Which command lets you experiment with terraform expressions?

  • A. Terraform validate
  • B. Terraform test
  • C. Terraform console
  • D. Terraform env

Answer: C

Explanation:
This is the command that lets you experiment with Terraform expressions, by providing an interactive console that allows you to evaluate expressions and see their results. You can use this command to test your expressions before using them in your configuration files.


NEW QUESTION # 57
If a module uses a local variable, you can expose that value with a terraform output.

  • A. True
  • B. False

Answer: A

Explanation:
Output values are like function return values.
Reference: https://www.terraform.io/docs/language/values/locals.html
https://www.terraform.io/docs/language/values/outputs.html


NEW QUESTION # 58
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 terraform apply again immediately afterwards without changing any Terraform code?

  • A. Nothing
  • B. Terraform will create another duplicate VM
  • C. Terraform will apply the VM to the state file
  • D. Terraform will terminate and recreate the VM

Answer: A


NEW QUESTION # 59
How do you specify a module's version when publishing it to the public terraform Module Registry?

  • A. Mention it on the module's configuration page on the Terraform Module Registry
  • B. Tag a release in the associated repo
  • C. The Terraform Module Registry does not support versioning modules
  • D. Configuration it in the module's Terraform code

Answer: B

Explanation:
This is how you specify a module's version when publishing it to the public Terraform Module Registry, as it uses the tags from your version control system (such as GitHub or GitLab) to identify module versions. You need to use semantic versioning for your tags, such as v1.0.0.


NEW QUESTION # 60
Your team lead does not trust the junior terraform engineers who now have access to the git repo . So , he wants you to have some sort of a checking layer , whereby , you can ensure that the juniors will not create any non-compliant resources that might lead to a security audit failure in future. What can you do to efficiently enforce this?

  • A. Use Terraform OSS Sentinel Lite version , which will save cost , since there is no charge for OSS , but it can still check for most non-compliant rules using Policy-As-Code.
  • B. Since your team is using Hashicorp Terraform Enterprise Edition , enable Sentinel , and write Policy-As-Code rules that will check for non-compliant resource provisioning , and prevent/report them.
  • C. Create a git master branch , and implement PR . Every change needs to be reviewed by you , before being merged to the master branch.
  • D. Create a design /security document (in PDF) and share to the team , and ask them to always follow that document , and never deviate from it.

Answer: B

Explanation:
Explanation
Sentinel is an embedded policy-as-code framework integrated with the HashiCorp Enterprise products. It enables fine-grained, logic-based policy decisions, and can be extended to use information from external sources.
https://www.terraform.io/docs/cloud/sentinel/index.html


NEW QUESTION # 61
What is the default backend for Terraform?

  • A. gcs
  • B. consul
  • C. local
  • D. etcd

Answer: C

Explanation:
Explanation
By default, Terraform uses the "local" backend, which is the normal behavior of Terraform you're used to.
https://www.terraform.io/docs/backends/index.html


NEW QUESTION # 62
Terraform Cloud always encrypts state at rest and protects it with TLS in transit. Terraform Cloud also knows the identity of the user requesting state and maintains a history of state changes.

  • A. True
  • B. False

Answer: A

Explanation:
Explanation
Terraform Cloud always encrypts state at rest and protects it with TLS in transit. Terraform Cloud also knows the identity of the user requesting state and maintains a history of state changes. This can be used to control access and track activity. Terraform Enterprise also supports detailed audit logging.
https://www.terraform.io/docs/state/sensitive-data.html#recommendations


NEW QUESTION # 63
......

TA-002-P Questions - Truly Beneficial For Your HashiCorp Exam: https://theexamcerts.lead2passexam.com/HashiCorp/valid-TA-002-P-exam-dumps.html