[Q11-Q34] Real HashiCorp TA-002-P Exam Questions [Updated 2024]

Share

Real HashiCorp TA-002-P Exam Questions [Updated 2024]

TA-002-P Exam Dumps Pass with Updated 2024 HashiCorp Certified: Terraform Associate


HashiCorp Certified: Terraform Associate (TA-002-P) exam is designed to test your knowledge of Terraform's core concepts, best practices, and configuration syntax. TA-002-P exam is intended for individuals who are new to Terraform or have some experience with the tool and want to demonstrate their proficiency. TA-002-P exam is not intended for experts with years of experience using Terraform, but for those who are just starting out or have limited experience with the tool.


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).

 

NEW QUESTION # 11
Terraform requires the Go runtime as a prerequisite for installation.

  • A. True
  • B. False

Answer: B

Explanation:
Explanation
Explanation/Reference: https://www.terraform.io/docs/extend/guides/v1-upgrade-guide.html


NEW QUESTION # 12
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. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
  • B. 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
  • C. Run terraform destroy then terraform apply and look for the IP address in stdout
  • D. Run terraform output ip_address to view the result

Answer: D


NEW QUESTION # 13
Which of the following is not an advantage of using infrastructure as code operations?

  • A. API driven workflows
  • B. Self-service infrastructure deployment
  • C. Modify a count parameter to scale resources
  • D. Public cloud console configuration workflows
  • E. Troubleshoot via a Linux diff command

Answer: E

Explanation:
Explanation
terraform is used to deploy the infrastructure, not to troubleshoot it


NEW QUESTION # 14
By default, a defined provisioner is a creation-time provisioner.

  • A. False
  • B. True

Answer: B

Explanation:
https://www.terraform.io/docs/provisioners/index.html


NEW QUESTION # 15
Select all Operating Systems that Terraform is available for. (select five)

  • A. FreeBSD
  • B. Solaris
  • C. Windows
  • D. Unix
  • E. Linux
  • F. macOS

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 # 16
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.)

  • A. Write Terraform configuration for the existing VMs
  • B. Run the terraform import-gcp command
  • C. Provision new VMs using Terraform with the same VM names
  • D. Use the terraform import command for the existing VMs

Answer: B,D

Explanation:
The terraform import command is used to import existing infrastructure. Import existing Google Cloud resources into Terraform with Terraformer.


NEW QUESTION # 17
You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into
a file called\

You immediately run terraform apply but don't see any changes. Your state file didn't move. Which command
will migrate your current state file to the new S3 remote backend?

  • A. terraform refresh
  • B. terraform init
  • C. terraform state
  • D. terraform push

Answer: B


NEW QUESTION # 18
In regards to Terraform state file, select all the statements below which are correct?

  • A. Storing state remotely can provide better security.
  • B. When using local state, the state file is stored in plain-text.
  • C. The state file is always encrypted at rest.
  • D. Using the mask feature, you can instruct Terraform to mask sensitive data in the state file.
  • E. Terraform Cloud always encrypts state at rest.
  • F. The Terraform state can contain sensitive data, therefore the state file should be protected from
    unauthorized access.

Answer: A,B,E,F

Explanation:
Explanation
Terraform state can contain sensitive data, depending on the resources in use and your definition of
"sensitive." The state contains resource IDs and all resource attributes. For resources such as databases, this
may contain initial passwords.
When using local state, state is stored in plain-text JSON files.
When using remote state, state is only ever held in memory when used by Terraform. It may be encrypted at
rest, but this depends on the specific remote state backend.
Storing Terraform state remotely can provide better security. As of Terraform 0.9, Terraform does not persist
state to the local disk when remote state is in use, and some backends can be configured to encrypt the state
data at rest.
Recommendations
If you manage any sensitive data with Terraform (like database passwords, user passwords, or private keys),
treat the state itself as sensitive data.
Storing state remotely can provide better security. As of Terraform 0.9, Terraform does not persist state to the
local disk when remote state is in use, and some backends can be configured to encrypt the state data at rest.
For example:
* 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.
* The S3 backend supports encryption at rest when the encrypt option is enabled. IAM policies and logging
can be used to identify any invalid access. Requests for the state go over a TLS connection.


NEW QUESTION # 19
What allows you to conveniently switch between multiple instances of a single configuration within its single backend?

  • A. Local backends
  • B. Providers
  • C. Remote backends
  • D. Workspaces

Answer: D

Explanation:
Explanation
Named workspaces allow conveniently switching between multiple instances of a single configuration within its single backend. ... A common use for multiple workspaces is to create a parallel, distinct copy of a set of infrastructure in order to test a set of changes before modifying the main production infrastructure.
Workspaces, allowing multiple states to be associated with a single configuration. The configuration still has only one backend, but multiple distinct instances of that configuration to be deployed without configuring a new backend or changing authentication credentials.
https://www.terraform.io/docs/state/workspaces.html


NEW QUESTION # 20
What does the command terraform fmt do?

  • A. Formats the state file in order to ensure the latest state of resources can be obtained.
  • B. Rewrite Terraform configuration files to a canonical format and style.
  • C. Deletes the existing configuration file.
  • D. Updates the font of the configuration file to the official font supported by HashiCorp.

Answer: B

Explanation:
Explanation
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style.
This command applies a subset of the Terraform language style conventions, along with other minor
adjustments for readability.
Other Terraform commands that generate Terraform configuration will produce configuration files that
conform to the style imposed by terraform fmt, so using this style in your own files will ensure consistency.
https://www.terraform.io/docs/commands/fmt.html


NEW QUESTION # 21
A colleague has informed you that a new version of a Terraform module that your team hosts on an Amazon
S3 bucket is broken. The Amazon S3 bucket has versioning enabled. Your colleague tells you to make sure
you are not using the latest version in your configuration. You have the following configuration block in your
code that refers to the module:
module "infranet" { source = "s3::https://s3-us-west-2.amazonaws.com/infrabucket/infra_module.zip"}
What is the best way to ensure that you are not using the latest version of the module?

  • A. Add a version key to the module configuration and specify a previous version.
  • B. Add a version property to the module in Terraform's state file and specify a previous version.
  • C. Add a module version constraint in your configuration's backend block and specify a previous version.
  • D. Delete the latest version of the module in S3 to rollback to the previous version.

Answer: D

Explanation:
Explanation
Version constraints are supported only for modules installed from a module registry, such as the Terraform
Registry or Terraform Cloud's private module registry. Other module sources can provide their own versioning
mechanisms within the source string itself, or might not support versions at all. In particular, modules sourced
from local file paths do not support version; since they're loaded from the same source repository.
Only Terraform Registries support module versioning by using the version key, one cannot configure a
previous version of the module in the configuration. Deleting the latest version of the module in S3 is the only
option of the available options that ensures you won't use the latest version. You could also modify the source
URL to specify a versionId URL parameter for a previous version.
https://www.terraform.io/docs/configuration/modules.html#source


NEW QUESTION # 22
Which one of the following command will rewrite Terraform configuration files to a canonical format and
style.

  • A. terraform init
  • B. terraform graph
  • C. terraform graph -h
  • D. terraform fmt

Answer: D

Explanation:
Explanation
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style.
This command applies a subset of the Terrra Terraform language style conventions, along with other minor
adjustments for readability.


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

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

Answer: A


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

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

Answer: B

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 # 25
Once a new Terraform backend is configured with a Terraform code block, which command(s) is (are) used to
migrate the state file?

  • A. terraform init
  • B. terraform destroy, then terraform apply
  • C. terraform apply
  • D. terraform push

Answer: D

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


NEW QUESTION # 26
How can you ensure that the engineering team who has access to git repo will not create any non-compliant resources that might lead to a security audit failure in future. your team is using Hashicorp Terraform Enterprise Edition.

  • 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. Implement a review process where every code will be reviewed before merging to the master branch.
  • C. 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.
  • 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: C

Explanation:
Explanation
https://www.terraform.io/docs/cloud/sentinel/index.html


NEW QUESTION # 27
What does Terraform use the .terraform.lock.hc1 file for?

  • A. Storing references to workspaces which are locked
  • B. Preventing Terraform runs from occurring
  • C. Tracking specific provider dependencies
  • D. There is no such file

Answer: C

Explanation:
The .terraform.lock.hcl file is a new feature in Terraform 0.14 that records the exact versions of each provider used in your configuration. This helps ensure consistent and reproducible behavior across different machines and runs.


NEW QUESTION # 28
resource "aws_s3_bucket" "example" { bucket = "my-test-s3-terraform-bucket" ...} resource "aws_iam_role" "test_role" { name = "test_role" ...} Due to the way that the application code is written , the s3 bucket must be created before the test role is created , otherwise there will be a problem. How can you ensure that?

  • A. Add explicit dependency using depends_on . This will ensure the correct order of resource creation.
  • B. This is not possible to control in terraform . Terraform will take care of it in a native way , and create a dependency graph that is best suited for the parallel resource creation.
  • C. Create 2 separate terraform config scripts , and run them one by one , 1 for s3 bucket , and another for IAM role , run the S3 bucket script first.
  • D. This will already be taken care of by terraform native implicit dependency. Nothing else needs to be done from your end.

Answer: A

Explanation:
Use the depends_on meta-argument to handle hidden resource dependencies that Terraform can't automatically infer.
Explicitly specifying a dependency is only necessary when a resource relies on some other resource's behavior but doesn't access any of that resource's data in its arguments.


NEW QUESTION # 29
Which of the following statements best describes the Terraform list(...) type?

  • A. a collection of values where each is identified by a string label.
  • B. a sequence of values identified by consecutive whole numbers starting with zero.
  • C. a collection of named attributes that each have their own type.
  • D. a collection of unique values that do not have any secondary identifiers or ordering.

Answer: B

Explanation:
A terraform list is a sequence of values identified by consecutive whole numbers starting with zero. https://www.terraform.io/docs/configuration/types.html#structural-types


NEW QUESTION # 30
Select all Operating Systems that Terraform is available for. (select five)

  • A. FreeBSD
  • B. Solaris
  • C. Windows
  • D. Unix
  • E. Linux
  • F. macOS

Answer: A,B,C,E,F

Explanation:
Terraform is available for macOS, FreeBSD, OpenBSD, Linux, Solaris, Windows https://www.terraform.io/downloads.html


NEW QUESTION # 31
Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform CLI?

  • A. Dry runs with terraform plan
  • B. Using the workspace as a data source
  • C. Secure variable storage
  • D. Support for multiple cloud providers

Answer: D


NEW QUESTION # 32
While using generic git repository as a module source, which of the below options allows terraform to select a
specific version or tag instead of selecting the HEAD.

  • A. Append version argument as
    module "vpc" { source = "git::https://example.com/vpc.git?version=v1.2.0"}
  • B. Append ref argument as
    module "vpc" { source = "git::https://example.com/vpc.git#ref=v1.2.0"}
  • C. Append ref argument as
    module "vpc" { source = "git::https://example.com/vpc.git?ref=v1.2.0"}
  • D. By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected
    repository and you can not override this.

Answer: C

Explanation:
Explanation
By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository.
You can override this using the ref argument:
module "vpc" {
source = "git::https://example.com/vpc.git?ref=v1.2.0"
}
The value of the ref argument can be any reference that would be accepted by the git checkout command,
including branch and tag names.
https://www.terraform.io/docs/modules/sources.html


NEW QUESTION # 33
Select all features which are exclusive to Terraform Enterprise. (Select Three)

  • A. Sentinel
  • B. Clustering
  • C. Cost Estimation
  • D. SAML/SSO
  • E. Audit Logs

Answer: B,D,E

Explanation:
Explanation
Sentinel and Cost Estimation are also available in Terraform Cloud
https://www.hashicorp.com/products/terraform/pricing/


NEW QUESTION # 34
......

TA-002-P Exam Dumps, TA-002-P Practice Test Questions: https://examsboost.actualpdf.com/TA-002-P-real-questions.html