2024 Valid TA-002-P test answers & HashiCorp Exam PDF
Free HashiCorp TA-002-P Exam Questions and Answer from Training Expert Actual4Dumps
The HashiCorp Certified: Terraform Associate certification exam is ideal for IT professionals who are looking to build their skills in cloud infrastructure management, automation, and deployment. HashiCorp Certified: Terraform Associate certification is not limited to any specific cloud platform or vendor and is recognized globally. This means that individuals who earn this certification can work with various cloud platforms and vendors, including Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP).
HashiCorp TA-002-P exam is designed to test the skills and knowledge of professionals in using Terraform to deploy and manage infrastructure as code. HashiCorp Certified: Terraform Associate certification is intended for those who are new to Terraform and want to demonstrate their proficiency in the tool. TA-002-P exam covers topics such as the Terraform workflow, resource management, configuration syntax, and basic networking concepts.
To prepare for the HashiCorp TA-002-P Certification Exam, candidates can take advantage of the various resources provided by HashiCorp, such as the official study guide, documentation, and sample questions. Additionally, candidates can enroll in training courses and workshops offered by HashiCorp and its partners. It is also recommended for candidates to have hands-on experience with Terraform and to practice using the tool in real-world scenarios.
NEW QUESTION # 27
Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform
CLI?
- A. Secure variable storage
- B. Using the workspace as a data source
- C. Support for multiple cloud providers
- D. Dry runs with terraform plan
Answer: A
Explanation:
Reference: https://www.terraform.io/docs/language/providers/configuration.html
NEW QUESTION # 28
Terraform is currently being used by your organisation to create resources on AWS for the development of a
web application. One of your coworkers wants to change the instance type to "t2.large" while keeping the
default set values.
What adjustments does the teammate make in order to meet his goal?
- A. Issue Terraform plan instance.type".t2.large" and it deploys the instance
- B. Modify the terraform.tfvars with the instance type and issue terraform plan and then terraform apply to
deploy the instances - C. Create a new file my.tfvars and add the type of the instance and issue terraform plan and apply
- D. Modify the tf.variableswith the instance type and issue terraform apply
Answer: B
NEW QUESTION # 29
A user runs terraform init on their RHEL based server and per the output, two provider plugins are
downloaded: $ terraform init
Initializing the backend...
Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "aws" (hashicorp/aws) 2.44.0...
- Downloading plugin for provider "random" (hashicorp/random) 2.2.1...
:
Terraform has been successfully initialized! Where are these plugins downloaded to?
- A. The .terraform.plugins directory in the directory terraform init was executed in.
- B. The .terraform/plugins directory in the directory terraform init was executed in.
- C. /etc/terraform/plugins
- D. The .terraform.d directory in the directory terraform init was executed in.
Answer: B
NEW QUESTION # 30
What type of block is used to construct a collection of nested configuration blocks?
- A. repeated.
- B. Nesting
- C. Dynamic
- D. For_each
Answer: C
Explanation:
This is the type of block that is used to construct a collection of nested configuration blocks, by using a for_each argument to iterate over a collection value and generate a nested block for each element. For example, you can use a dynamic block to create multiple ingress rules for a security group resource.
NEW QUESTION # 31
Multiple configurations for the same provider can be used in a single configuration file.
- A. False
- B. True
Answer: B
Explanation:
Explanation
You can optionally define multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis. The primary reason for this is to support multiple regions for a cloud platform; other examples include targeting multiple Docker hosts, multiple Consul hosts, etc.
To include multiple configurations for a given provider, include multiple provider blocks with the same provider name, but set the alias meta-argument to an alias name to use for each additional configuration. For example:
# The default provider configuration
provider "aws" {
region = "us-east-1"
}
# Additional provider configuration for west coast region
provider "aws" {
alias = "west"
region = "us-west-2"
}
The provider block without alias set is known as the default provider configuration. When alias is set, it creates an additional provider configuration. For providers that have no required configuration arguments, the implied empty configuration is considered to be the default provider configuration.
https://www.terraform.io/docs/configuration/providers.html#alias-multiple-provider-instances
NEW QUESTION # 32
You want terraform plan and apply to be executed in Terraform Cloud's run environment but the output is to be streamed locally. Which one of the below you will choose?
- A. Remote Backends
- B. Terraform Backends
- C. This can be done using any of the local or remote backends
- D. Local Backends
Answer: A
Explanation:
Explanation
The remote backend stores Terraform state and may be used to run operations in Terraform Cloud.
When using full remote operations, operations like terraform plan or terraform apply can be executed in Terraform Cloud's run environment, with log output streaming to the local terminal.
Remote plans and applies use variable values from the associated Terraform Cloud workspace.
https://www.terraform.io/docs/backends/types/remote.html
NEW QUESTION # 33
Which of the following is not an advantage of using infrastructure as code operations?
- A. API driven workflows
- B. Public cloud console configuration workflows
- C. Self-service infrastructure deployment
- D. Modify a count parameter to scale resources
- E. Troubleshoot via a Linux diff command
Answer: E
Explanation:
Explanation
terraform is used to deploy the infrastructure, not to troubleshoot it
NEW QUESTION # 34
What is the command you can use to set an environment variable named "var1"of type String?
- A. export TF_VAR_var1
- B. export TF_VAR_VAR1
- C. variable "var1" { type = "string"}
- D. set TF_VAR_var1
Answer: A
Explanation:
The environment variable must be in the format TF_VAR_name, so for the
https://www.terraform.io/docs/commands/environment-variables.html#tf_var_name
NEW QUESTION # 35
Your company has a lot of workloads in AWS , and Azure that were respectively created using CloudFormation , and AzureRM Templates. However , now your CIO has decided to use Terraform for all new projects , and has asked you to check how to integrate the existing environment with terraform code.
What should be your next plan of action?
- A. Use terraform import command to import each resource one by one .
- B. Just write the terraform config file for the new resources , and run terraform apply , the state file will automatically be updated with the details of the new resources to be imported.
- C. Tell the CIO that this is not possible . Resources created in CloudFormation , and AzureRM templates cannot be tracked using terraform.
- D. This is only possible in Terraform Enterprise , which has the TerraformConverter exe that can take any other template language like AzureRM and convert to Terraform code.
Answer: A
NEW QUESTION # 36
When you initialize Terraform, where does it cache modules from the public Terraform Module Registry?
- A. On disk in the /tmp directory
- B. They are not cached
- C. On disk in the .terraform sub-directory
- D. In memory
Answer: C
Explanation:
Explanation
"A hidden .terraform directory, which Terraform uses to manage cached provider plugins and modules, record
which workspace is currently active, and record the last known backend configuration in case it needs to
migrate state on the next run. This directory is automatically managed by Terraform, and is created during
initialization." https://www.terraform.io/cli/init
NEW QUESTION # 37
colleagues is new toTerraform and wants to add a new workspace named new-hire. What command he should
execute from the following?
- A. terraform workspace new new hire
- B. terraform workspace-new-new-hire
- C. terraform workspace init new-hire
- D. terraform workspace new-hire
Answer: A
NEW QUESTION # 38
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
- A. You can import infrastructure without corresponding Terraform code
- B. Before you run terraform Import
- C. Terraform will generate the corresponding configuration files for you
- D. After you run terraform import
Answer: B
Explanation:
You need to write Terraform configuration files for the existing infrastructure that you want to import into Terraform, otherwise Terraform will not know how to manage it. The configuration files should match the type and name of the resources that you want to import.
NEW QUESTION # 39
The current implementation of Terraform import can only import resources into the state. It does not generate
configuration.
- A. False
- B. True
Answer: B
Explanation:
Explanation
The current implementation of Terraform import can only import resources into the state. It does not generate
configuration. A future version of Terraform will also generate configuration.
Because of this, prior to running terraform import it is necessary to write manually a resource configuration
block for the resource, to which the imported object will be mapped.
While this may seem tedious, it still gives Terraform users an avenue for importing existing resources.
https://www.terraform.io/docs/import/index.html#currently-state-only
NEW QUESTION # 40
Which option can not be used to keep secrets out of Terraform configuration files?
- A. A -var flag
- B. Environment variables
- C. secure string
- D. A Terraform provider
Answer: A
Explanation:
Explanation/Reference: https://secrethub.io/blog/secret-management-for-terraform/
NEW QUESTION # 41
What features stops multiple admins from changing the Terraform state at the same time?
- A. State locking
- B. Provider constraints
- C. Version control
- D. Backend types
Answer: A
Explanation:
Explanation
Somewhat ambiguous question however the key phrase is "feature". You need a remote backend first with a
State Locking feature available to avoid this scenario.
https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa
NEW QUESTION # 42
A provider configuration block is required in every Terraform configuration.
Example:
- A. True
- B. False
Answer: B
Explanation:
Explanation
Unlike many other objects in the Terraform language, a provider block may be omitted if its contents would
otherwise be empty. Terraform assumes an empty default configuration for any provider that is not explicitly
configured. https://www.terraform.io/language/providers/configuration
NEW QUESTION # 43
Select all Operating Systems that Terraform is available for. (select five)
- A. FreeBSD
- B. Windows
- C. macOS
- D. Unix
- E. Solaris
- F. Linux
Answer: A,B,C,E,F
Explanation:
Explanation
Terraform is available for macOS, FreeBSD, OpenBSD, Linux, Solaris, Windows
https://www.terraform.io/downloads.html
NEW QUESTION # 44
During a terraform apply, a resource is successfully created but eventually fails during provisioning. What happens to the resource?
- A. The failure of provisioner will be ignored and it will not cause a failure to terraform apply
- B. The resource will be automatically destroyed.
- C. The resource will be planned for destruction and recreation upon the next terraform apply
- D. Terraform will retry to provision again.
Answer: C
Explanation:
If a creation-time provisioner fails, the resource is marked as tainted. A tainted resource will be planned for destruction and recreation upon the next terraform apply. Terraform does this because a failed provisioner can leave a resource in a semi-configured state. Because Terraform cannot reason about what the provisioner does, the only way to ensure proper creation of a resource is to recreate it. This is tainting.
You can change this behavior by setting the on_failure attribute, which is covered in detail below.
https://www.terraform.io/docs/provisioners/index.html#creation-time-provisioners
https://www.terraform.io/docs/provisioners/index.html#destroy-time-provisioners
https://www.terraform.io/docs/provisioners/index.html#failure-behavior
NEW QUESTION # 45
Which of the following is not a valid Terraform collection type?
- A. map
- B. set
- C. list
- D. tree
Answer: D
Explanation:
Explanation
https://www.terraform.io/language/expressions/type-constraints#collection-types
NEW QUESTION # 46
What Terraform feature is shown in the example below?
- A. local values
- B. data source
- C. conditional expression
- D. dynamic block
Answer: D
NEW QUESTION # 47
terraform refresh command will not modify infrastructure, but does modify the state file.
- A. False
- B. True
Answer: B
Explanation:
Explanation
The terraform refresh command is used to reconcile the state Terraform knows about (via its state file) with the real-world infrastructure. This can be used to detect any drift from the last-known state, and to update the state file. This does not modify infrastructure, but does modify the state file.
https://www.terraform.io/docs/commands/refresh.html
NEW QUESTION # 48
The canonical format may change in minor ways between Terraform versions, so after upgrading Terraform it is recommended to proactively run.
- A. terraform fmt
- B. terraform validate
- C. terraform init
- D. terraform plan
Answer: A
NEW QUESTION # 49
True or False? When using the Terraform provider for Vault, the tight integration between these HashiCorp tools provides the ability to mask secrets in the terraform plan and state files.
- A. True
Explanation
Currently, Terraform has no mechanism to redact or protect secrets that are returned via data sources, so secrets read via this provider will be persisted into the Terraform state, into any plan files, and in some cases in the console output produced while planning and applying. These artifacts must, therefore, all be protected accordingly. - B. False
Answer: B
NEW QUESTION # 50
Select two answers to complete the following sentence: Before a new provider can be used, it must be ______ and _______.
- A. approved by HashiCorp
- B. declared in the configuration
- C. uploaded to source control
- D. initialized
Answer: B,D
Explanation:
Explanation
Each time a new provider is added to configuration -- either explicitly via a provider block or by adding a resource from that provider -- Terraform must initialize the provider before it can be used. Initialization downloads and installs the provider's plugin so that it can later be executed.
NEW QUESTION # 51
......
Top HashiCorp TA-002-P Courses Online: https://freetorrent.actual4dumps.com/TA-002-P-study-material.html