[Feb-2023] Verified HashiCorp TA-002-P Bundle Real Exam Dumps PDF [Q21-Q42]

Share

[Feb-2023] Verified HashiCorp TA-002-P Bundle Real Exam Dumps PDF

TA-002-P Dumps PDF New [2023] Ultimate Study Guide


Exam Topics for HashiCorp Certified: Terraform Associate TA-002-P Professional Exam

The following will be practiced in HASHICORP TA-002 practice exam and HASHICORP TA-002 practice exams:

  • Terraform workflow
  • Terraform basics
  • Terraform CLI (outside of core workflow)
  • Terraform modules
  • Execute and maintain state
  • Terraform's purpose (vs other IaC)
  • Terraform Cloud capabilities
  • Infrastructure as code (IaC) concepts

HashiCorp TA-002-P Exam Syllabus Topics:

TopicDetails
Topic 1
  • Execute changes to infrastructure with Terraform (terraform apply)
  • Handle Terraform and provider installation and versioning
Topic 2
  • Given a scenario: choose when to enable verbose logging and what the outcome
  • value is
  • Interact with module inputs and outputs
Topic 3
  • Use Terraform built-in functions to write configuration
  • Generate and review an execution plan for Terraform (terraform plan)
Topic 4
  • Discover modules from the public Terraform Module Registry
  • Initialize a Terraform working directory (terraform init)
Topic 5
  • Destroy Terraform managed infrastructure (terraform destroy)
  • Given a scenario: choose when to use terraform fmt to format code
Topic 6
  • Describe the benefits of Sentinel, registry, and workspaces
  • Describe variable scope within modules
  • child modules
Topic 7
  • Explain multi-cloud and provider-agnostic benefits
  • Understand infrastructure as code (IaC) concepts
Topic 8
  • Create and differentiate resource and data configuration
  • Understand the use of collection and structural types
Topic 9
  • Given a scenario: choose when to use terraform taint to taint Terraform resources
  • Handle backend authentication methods
Topic 10
  • Describe backend block in configuration and best practices for partial configurations
  • Demonstrate using multiple providers
Topic 11
  • Explain when to use and not use provisioners and when to use local-exec or remote-exec
  • Describe advantages of IaC patterns
Topic 12
  • Describe secure secret injection best practice
  • Use resource addressing and resource parameters to connect resources together
Topic 13
  • Describe remote state storage mechanisms and supported standard backends
  • Describe how Terraform finds and fetches providers


How to schedule HashiCorp Certified: Terraform Associate TA-002-P Professional Exam

To apply for the HashiCorp Certified: Terraform Associate TA-002-P Professional Exam, You have to follow these steps:

• Step 1: Go to the HashiCorp Certified: Terraform Associate TA-002-P Professional Official Site. You must first create an account, use your email address to register. You must purchase your training through your local distributor. If you are a partner, you must first create an account on the Partner Portal. You must use your company email address to register. • Step 2: Read the instruction Carefully • Step 3: Follow the given steps • Step 4: Apply for the HashiCorp Certified: Terraform Associate TA-002-P-Professional Exam

 

NEW QUESTION 21
You want terraform plan and terraform 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. This can be done using any of the local or remote backends.
  • C. Terraform Backends.
  • D. Local Backends.

Answer: A

Explanation:
Explanation
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.
Terraform Cloud can also be used with local operations, in which case only state is stored in the Terraform
Cloud backend.
https://www.terraform.io/docs/backends/types/remote.html

 

NEW QUESTION 22
Which of the following is the correct way to pass the value in the variable num_servers into a module with the
input servers?

  • A. servers = var.num_servers
  • B. servers = variable.num_servers
  • C. servers = var(num_servers)
  • D. servers = num_servers

Answer: A

Explanation:
Explanation
"Within the module that declared a variable, its value can be accessed from within expressions as
var.<NAME>, where <NAME> matches the label given in the declaration block:
Note: Input variables are created by a variable block, but you reference them as attributes on an object named
var."
https://www.terraform.io/language/values/variables#using-input-variable-values

 

NEW QUESTION 23
terraform validate reports HCL syntax errors.

  • A. True
  • B. False

Answer: A

 

NEW QUESTION 24
Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?

  • A. terraform taint
  • B. terraform destroy
  • C. terraform refresh
  • D. terraform fmt

Answer: A

Explanation:
Explanation
The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be
destroyed and recreated on the next apply.
This command will not modify infrastructure, but does modify the state file in order to mark a resource as
tainted. Once a resource is marked as tainted, the next plan will show that the resource will be destroyed and
recreated and the next apply will implement this change.
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not
visible in the attributes of a resource. For example: re-running provisioners will cause the node to be different
or rebooting the machine from a base image will cause new startup scripts to run.
Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For
example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially
new IP address of a tainted server. The plan command will show this if this is the case.
https://www.terraform.io/docs/commands/taint.html

 

NEW QUESTION 25
Which of the following is the right substitute for static values that can make Terraform configuration file more
dynamic and reusable?

  • A. Input parameters
  • B. Modules
  • C. Functions
  • D. Output value

Answer: A

Explanation:
Explanation
Input variables serve as parameters for a Terraform module, allowing aspects of the module to be customized
without altering the module's own source code, and allowing modules to be shared between different
configurations.

 

NEW QUESTION 26
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:
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 27
Multiple configurations for the same provider can be used in a single configuration file.

  • A. True
  • B. False

Answer: A

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 28
Provider dependencies are created in several different ways. Select the valid provider dependencies from the following list: (select three)

  • A. Existence of any resource instance belonging to a particular provider in the current state.
  • B. Use of any resource belonging to a particular provider in a resource or data block in configuration.
  • C. Existence of any provider plugins found locally in the working directory.
  • D. Explicit use of a provider block in configuration, optionally including a version constraint.

Answer: A,B,D

Explanation:
Explanation
The existence of a provider plugin found locally in the working directory does not itself create a provider dependency. The plugin can exist without any reference to it in the terraform configuration.
https://www.terraform.io/docs/commands/providers.html

 

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

  • A. The resource will be automatically destroyed.
  • B. The resource will be planned for destruction and recreation upon the next terraform apply
  • C. The failure of provisioner will be ignored and it will not cause a failure to terraform apply
  • D. Terraform will retry to provision again.

Answer: B

Explanation:
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 30
You cannot publish your own modules on the Terraform Registry.

  • A. True
  • B. False

Answer: B

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

 

NEW QUESTION 31
You have deployed a new webapp with a public IP address on a clod 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?

  • A. In a new folder, use the terraform_remote_state data source to load in the state file, then write an output
    for each resource that you find the state file
  • B. Run terraform destroy then terraform apply and look for the IP address in stdout
  • C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes
    including public IP address
  • D. Run terraform output ip_address to view the result

Answer: C

Explanation:
Explanation
https://www.terraform.io/cli/commands/state/show

 

NEW QUESTION 32
Which of the following allows Terraform users to apply policy as code to enforce standardized configurations for resources being deployed via infrastructure as code?

  • A. Workspaces
  • B. Functions
  • C. Module registry
  • D. Sentinel

Answer: D

Explanation:
Explanation
Sentinel is a language and framework for policy built to be embedded in existing software to enable fine-grained, logic-based policy decisions. A policy describes under what circumstances certain behaviors are allowed. Sentinel is an enterprise-only feature.
https://www.youtube.com/watch?v=Vy8s7AAvU6g&feature=emb_title

 

NEW QUESTION 33
What is the purpose of a Terraform workspace in either open source of enterprise?

  • A. A logical separation of business units
  • B. Workspaces allow you to manage collections of infrastructure in state files.
  • C. A method of grouping multiple infrastructure security policies
  • D. Provides limited access to a cloud environment

Answer: A

 

NEW QUESTION 34
Which option can not be used to keep secrets out of Terraform configuration files?

  • A. A Terraform provider
  • B. Environment variables
  • C. secure string
  • D. A -var flag

Answer: A

Explanation:
Reference: https://secrethub.io/blog/secret-management-for-terraform/

 

NEW QUESTION 35
The canonical format may change in minor ways between Terraform versions, so after upgrading Terraform it
is recommended to proactively run.

  • A. terraform init
  • B. terraform validate
  • C. terraform plan
  • D. terraform fmt

Answer: D

 

NEW QUESTION 36
When configuring a remote backend in Terraform, it might be a good idea to purposely omit some of the required arguments to ensure secrets and other important data aren't inadvertently shared with others. What are the ways the remaining configuration can be added to Terraform so it can initialize and communicate with the backend? (select three)

  • A. command-line key/value pairs
  • B. use the -backend-config=PATH to specify a separate config file
  • C. interactively on the command line
  • D. directly querying HashiCorp Vault for the secrets

Answer: A,B,C

Explanation:
Explanation
You do not need to specify every required argument in the backend configuration. Omitting certain arguments may be desirable to avoid storing secrets, such as access keys, within the main configuration. When some or all of the arguments are omitted, we call this a partial configuration.
With a partial configuration, the remaining configuration arguments must be provided as part of the initialization process. There are several ways to supply the remaining arguments: https://www.terraform.io/docs/backends/init.html#backend-initialization

 

NEW QUESTION 37
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not
visible in the attributes of a resource. What command will do this?

  • A. terraform taint
  • B. terraform refresh
  • C. terraform graph
  • D. terraform apply

Answer: A

Explanation:
Explanation
The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be
destroyed and recreated on the next apply.
This command will not modify infrastructure, but does modify the state file in order to mark a resource as
tainted. Once a resource is marked as tainted, the next plan will show that the resource will be destroyed and
recreated and the next apply will implement this change.
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not
visible in the attributes of a resource. For example: re-running provisioners will cause the node to be different
or rebooting the machine from a base image will cause new startup scripts to run.
Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For
example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially
new IP address of a tainted server. The plan command will show this if this is the case.
This example will taint a single resource:
$ terraform taint aws_security_group.allow_all
The resource aws_security_group.allow_all in the module root has been marked as tainted.
https://www.terraform.io/docs/commands/taint.html

 

NEW QUESTION 38
The following is a snippet from a Terraform configuration file:
Which, when validated, results in the following error:
Fill in the blank in the error message with the correct string from the list below.

  • A. version
  • B. multi
  • C. alias
    Explanation
    https://www.terraform.io/docs/configuration/providers.html#alias-multiple-providerinstances
  • D. label

Answer: C

 

NEW QUESTION 39
In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer
to providers by their local names.

  • A. True
  • B. False

Answer: A

Explanation:
Explanation
Outside of the required_providers block, Terraform configurations always refer to providers by their local
names.
Reference: https://www.terraform.io/docs/language/providers/requirements.html
https://www.terraform.io/language/providers/requirements#local-names

 

NEW QUESTION 40
What features does the hosted service Terraform Cloud provide? (Choose two.)

  • A. Automatic backups
  • B. A web-based user interface (UI)
  • C. Remote state storage
  • D. Automated infrastructure deployment visualization

Answer: A,C

Explanation:
Reference:
https://www.terraform.io/docs/enterprise/admin/automated-recovery.html https://www.terraform.io/docs/language/state/remote.html

 

NEW QUESTION 41
In the below configuration, how would you reference the module output vpc_id ?

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:
modulevpcid

 

NEW QUESTION 42
......

Pass Your HashiCorp Exam with TA-002-P Exam Dumps: https://examkiller.itexamreview.com/TA-002-P-valid-exam-braindumps.html