Free May-2023 TA-002-P Certification Sample Questions certification Exam [Q157-Q181]

Share

Free May-2023 TA-002-P Certification Sample Questions certification Exam

Certification Topics of TA-002-P Exam PDF Recently Updated Questions


The exam consists of 60 multiple-choice questions that need to be completed within 90 minutes. To pass the exam, candidates must score at least 70%. The exam covers a wide range of topics related to Terraform, including its basic concepts, configuration language, providers, resources, state management, and best practices for using Terraform.

 

NEW QUESTION # 157
What is the best and easiest way for Terraform to read and write secrets from HashiCorp Vault?

  • A. Vault provider
  • B. integration with a tool like Jenkins
  • C. API access using the AppRole auth method
  • D. CLI access from the same machine running Terraform

Answer: A


NEW QUESTION # 158
The current implementation of Terraform import can only import resources into the state. It does not generate
configuration.

  • A. True
  • B. False

Answer: A

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 # 159
Complete the following sentence:
The terraform state command can be used to ____

  • A. modify state
  • B. view state
  • C. refresh state
  • D. There is no such command

Answer: A

Explanation:
Explanation
https://www.terraform.io/docs/commands/state/index.html


NEW QUESTION # 160
You have 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 will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)

  • A. Run terraform plan -destroy.
  • B. This is not possible. You can only show resources that will be created.
  • C. Run terraform state rm *.
  • D. Run terraform destroy and it will first output all the resources that will be deleted before prompting for
    approval.

Answer: A,D

Explanation:
Reference: https://www.terraform.io/docs/cli/commands/state/rm.html


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

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

Answer: B,C,D,E,F

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


NEW QUESTION # 162
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. file
  • B. null-exec
  • C. local-exec
  • D. remote-exec

Answer: D

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


NEW QUESTION # 163
Command terraform refresh will update state file?

  • A. True
  • B. False

Answer: A

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. If the state is changed, this may cause changes to occur during the next plan or apply.
https://www.terraform.io/docs/commands/refresh.html


NEW QUESTION # 164
Which one of the following will run echo 0 and echo 1 on a newly created host?

  • A. provisioner "remote-exec" {inline = ["echo 0","echo 1"]}
  • B. provisioner "local-exec" { command = "echo 0"command = "echo 1"}
  • C. provisioner "remote-exec" {inline = [echo 0,echo 1]}
  • D. provisioner "remote-exec" {command = "${echo 0}"command = "${echo 1}"}

Answer: A

Explanation:
remote-exec Provisioner
Example usage
resource "aws_instance" "web" {
# ...
provisioner "remote-exec" {
inline = [
"puppet apply",
"consul join ${aws_instance.web.private_ip}",
]
}
}


NEW QUESTION # 165
Terraform Enterprise currently supports running under which the following operating systems?

  • A. Ubuntu
  • B. CentOS
  • C. Amazon Linux
  • D. Debian
  • E. Red Hat Enterprise Linux
  • F. Oracle Linux

Answer: A,B,C,D,E,F

Explanation:
Explanation
Terraform Enterprise runs on Linux instances, and you must prepare a running Linux instance for Terraform
Enterprise before running the installer. You will start and manage this instance like any other server.
Terraform Enterprise currently supports running under the following operating systems:
Standalone deployment:
Debian 7.7+
Ubuntu 14.04.5 / 16.04 / 18.04
Red Hat Enterprise Linux 7.4 - 7.8
CentOS 6.x / 7.4 - 7.8
Amazon Linux 2014.03 / 2014.09 / 2015.03 / 2015.09 / 2016.03 / 2016.09 / 2017.03 / 2017.09 / 2018.03 / 2.0
Oracle Linux 7.4 - 7.8
https://www.terraform.io/docs/enterprise/before-installing/index.html


NEW QUESTION # 166
The terraform.tfstate file always matches your currently built infrastructure.

  • A. True
  • B. False

Answer: B

Explanation:
Reference: https://www.terraform.io/docs/language/state/index.html


NEW QUESTION # 167
Which of the following actions are performed during a terraform init?

  • A. Download the declared providers which are supported by HashiCorp
  • B. Initializes the backend configuration
  • C. Provisions the declared resources in your configuration
  • D. Initializes downloaded and/or installed providers

Answer: A,B,D

Explanation:
Explanation
The terraform init command is used to initialize a working directory containing Terraform configuration files.
This is the first command that should be run after writing a new Terraform configuration or cloning an existing one from version control. It is safe to run this command multiple times.
This command is always safe to run multiple times, to bring the working directory up to date with changes in the configuration. Though subsequent runs may give errors, this command will never delete your existing configuration or state.
terraform init command does -
* Copy a Source Module
* Backend Initialization
* Child Module Installation
* Plugin Installation
https://www.terraform.io/docs/commands/init.html


NEW QUESTION # 168
You have 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 will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)

  • A. Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.
  • B. This is not possible. You can only show resources that will be created.
  • C. Run terraform state rm *.
  • D. Run terraform plan -destroy.

Answer: A,C

Explanation:
Explanation/Reference: https://www.terraform.io/docs/cli/commands/state/rm.html


NEW QUESTION # 169
You are 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. Option B
  • B. Option A
  • C. Option C

Answer: A

Explanation:
Explanation
https://www.terraform.io/language/providers/configuration


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

  • A. True
  • B. False

Answer: B


NEW QUESTION # 171
Which of the following is an invalid variable name?

  • A. var1
  • B. instance_name
  • C. count
  • D. web

Answer: C

Explanation:
https://www.terraform.io/intro/examples/count.html


NEW QUESTION # 172
Which of the below features of Terraform can be used for managing small differences between different environments which can act more like completely separate working directories.

  • A. Environment Variables
  • B. Backends
  • C. Workspaces
  • D. Repositories

Answer: C

Explanation:
Explanation
workspaces allow conveniently switching between multiple instances of a single configuration within its single backend. They are convenient in a number of situations, but cannot solve all problems.
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. For example, a developer working on a complex set of infrastructure changes might create a new temporary workspace in order to freely experiment with changes without affecting the default workspace.
Non-default workspaces are often related to feature branches in version control. The default workspace might correspond to the "master" or "trunk" branch, which describes the intended state of production infrastructure.
When a feature branch is created to develop a change, the developer of that feature might create a corresponding workspace and deploy into it a temporary "copy" of the main infrastructure so that changes can be tested without affecting the production infrastructure. Once the change is merged and deployed to the default workspace, the test infrastructure can be destroyed and the temporary workspace deleted.
https://www.terraform.io/docs/state/workspaces.html
https://www.terraform.io/docs/state/workspaces.html#when-to-use-multiple-workspaces


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

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

Answer: B

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 # 174
Which Terraform collection type should you use to store key/value pairs?

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

Answer: B


NEW QUESTION # 175
Select the operating systems which are supported for a clustered Terraform Enterprise: (select four)

  • A. Ubuntu
  • B. CentOS
  • C. Amazon Linux
  • D. Unix
  • E. Red Hat

Answer: A,B,C,E

Explanation:
https://www.terraform.io/docs/enterprise/before-installing/index.html#operating-systemrequirements


NEW QUESTION # 176
True or False: Workspaces provide identical functionality in the open-source, Terraform Cloud, and Enterprise versions of Terraform.

  • A. True
  • B. False

Answer: B

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


NEW QUESTION # 177
The terraform init command is always safe to run multiple times, to bring the working directory up to date with changes in the configuration. Though subsequent runs may give errors, this command will never delete your existing configuration or state.

  • A. True
  • B. False

Answer: A

Explanation:
https://www.terraform.io/docs/commands/init.html


NEW QUESTION # 178
Which of the following is not true of Terraform providers?

  • A. Major cloud vendors and non-cloud vendors can write, maintain, or collaborate on Terraform providers
  • B. Some providers are maintained by HashiCorp
  • C. None of the above
  • D. Providers can be maintained by a community of users
  • E. Providers can be written by individuals

Answer: A


NEW QUESTION # 179
Which of the following is an invalid variable name?

  • A. instance_name
    Explanation
    https://www.terraform.io/intro/examples/count.html
  • B. var1
  • C. count
  • D. web

Answer: C


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

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

Answer: B


NEW QUESTION # 181
......

2023 New Preparation Guide of HashiCorp TA-002-P Exam: https://lead2pass.troytecdumps.com/TA-002-P-troytec-exam-dumps.html