[Aug 30, 2021] New 2021 HashiCorp TA-002-P Exam Dumps with PDF from BraindumpsPrep (Updated 324 Questions) [Q142-Q163]

Share

New 2021 TA-002-P exam questions Welcome to download the newest BraindumpsPrep TA-002-P PDF dumps (324  Q&As)

P.S. Free 2021 HashiCorp Infrastructure Automation TA-002-P  dumps are available on Google Drive shared by BraindumpsPrep

NEW QUESTION 142
Which of the following is not a valid string function in Terraform?

  • A. slice
  • B. split
  • C. join
  • D. chomp

Answer: D

Explanation:
Reference: https://www.terraform.io/docs/language/functions/chomp.html

 

NEW QUESTION 143
How can terraform plan aid in the development process?

  • A. Validates your expectations against the execution plan without permanently modifying state
  • B. Reconciles Terraform's state against deployed resources and permanently modifies state using the current status of deployed resources
  • C. Formats your Terraform configuration files
  • D. Initializes your working directory containing your Terraform configuration files

Answer: A

 

NEW QUESTION 144
Your team has started using terraform OSS in a big way , and now wants to deploy multi region deployments (DR) in aws using the same terraform files . You want to deploy the same infra (VPC,EC2 ...) in both us-east-1 ,and us-west-2 using the same script , and then peer the VPCs across both the regions to enable DR traffic. But , when you run your script , all resources are getting created in only the default provider region.
What should you do? Your provider setting is as below -
# The default provider configuration provider "aws" { region = "us-east-1" }

  • A. No way to enable this via a single script . Write 2 different scripts with different default providers in the
    2 scripts , one for us-east , another for us-west.
  • B. Create a list of regions , and then use a for-each to iterate over the regions , and create the same resources ,one after the one , over the loop.
  • C. Use provider alias functionality , and add another provider for us-west region . While creating the resources using the tf script , reference the appropriate provider (using the alias).
  • D. Manually create the DR region , once the Primary has been created , since you are using terraform OSS , and multi region deployment is only available in Terraform Enterprise.

Answer: C

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"
}
https://www.terraform.io/docs/configuration/providers.html

 

NEW QUESTION 145
A single terraform resource file that defines an aws_instance resource can simple be renamed to azurerm_virtual_machine in order to switch cloud providers

  • A. False
  • B. True

Answer: A

Explanation:
Providers usually require some configuration of their own to specify endpoint URLs, regions, authentication settings.
Providers Initialization can be done by either explicitly via a provider block or by adding a resource from that provide
https://www.terraform.io/docs/configuration/providers.html

 

NEW QUESTION 146
When running the command terraform taint against a managed resource you want to force recreation upon, Terraform will immediately destroy and recreate the resource.

  • A. False
  • B. True

Answer: A

 

NEW QUESTION 147
Which provisioner invokes a process on the resource created by Terraform?

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

Answer: A

Explanation:
The remote-exec provisioner invokes a script on a remote resource after it is created. Reference: https://www.terraform.io/docs/language/resources/provisioners/remote-exec.html

 

NEW QUESTION 148
What is the workflow for deploying new infrastructure with Terraform?

  • A. terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure
  • B. terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure
  • C. Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.
  • D. Write a Terraform configuration, run terraform init, run terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.

Answer: A

Explanation:
Reference:
https://www.google.com/search?q=Write+a+Terraform+configuration%2C+run+terraform+init%2C
+run+terraform+plan+to+view+planned+infrastructure+changes%2C+and+terraform+apply+to+create+new
+infrastructure.&oq=Write+a+Terraform+configuration%2C+run+terraform+init%2C+run+terraform+plan+to
+view+planned+infrastructure+changes%2C+and+terraform+apply+to+create+new
+infrastructure.&aqs=chrome..69i57.556j0j7&sourceid=chrome&ie=UTF-8

 

NEW QUESTION 149
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. WorkSpaces
  • B. State Locking
  • C. Encryption
  • D. Object Storage

Answer: B

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 150
You have created an AWS EC2 instance of type t2.micro through your terraform configuration file ec2.tf . Now you want to change the instance type from t2.micro to t2.medium. Accordingly you have changed your configuration file and and ran terraform plan. After running terraform plan you check the output and saw one instance will be updated from t2.micro --> t2.medium. After this you went to grab a coffee without running terraform apply and meanwhile a member of your team changed the instance type of that EC2 instance to t2.medium from aws console. After coming to your desk you run terraform apply. What will happen?

  • A. The instance type will be changed to t2.micro and again will be changed to t2.medium
  • B. No resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 0 changed, 0 destroyed.
  • C. terraform apply will through an error.
  • D. 1 resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 1 changed, 0 destroyed.

Answer: B

 

NEW QUESTION 151
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 152
Which of the following actions are performed during a terraform init?

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

Answer: B,C,D

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 153
What is the command you can use to set an environment variable named "var1"of type String?

  • A. export TF_VAR_var1
  • B. variable "var1" { type = "string"}
  • C. set TF_VAR_var1
  • D. export TF_VAR_VAR1

Answer: A

Explanation:
The environment variable must be in the format TF_VAR_name, so for the

 

NEW QUESTION 154
Given the Terraform configuration below, in which order will the resources be created?

  • A. aws_instance will be created first aws_eip will be created second
  • B. Larger image
  • C. aws_eip will be created first aws_instance will be created second
  • D. resources will be created simultaneously

Answer: A

Explanation:
Explanation
The aws_instance will be created first, and then aws_eip will be created second due to the aws_eip's resource dependency of the aws_instance id

 

NEW QUESTION 155
You need to constrain the GitHub provider to version 2.1 or greater.
Which of the following should you put into the Terraform 0.12 configuration's provider block?

  • A. version = "<= 2.1"
  • B. version ~> 2.1
  • C. version = ">= 2.1"
  • D. version >= 2.1

Answer: B

 

NEW QUESTION 156
Multiple configurations for the same provider can be used in a single configuration file.

  • A. True
  • B. False

Answer: A

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 157
Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.

  • A. True
  • B. False

Answer: A

 

NEW QUESTION 158
A data block requests that Terraform read from a given data source and export the result under the given local name.

  • A. True
  • B. False

Answer: A

 

NEW QUESTION 159
You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you need to rerun the script.
Which of the following commands would you use first?

  • A. terraform apply -target=null_resource.run_script
  • B. terraform plan -target=null_resource.run_script
  • C. terraform validate null_resource.run_script
  • D. terraform taint null_resource.run_script

Answer: D

 

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

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

Answer: C,D

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

 

NEW QUESTION 161
Which Terraform command will check and report errors within modules, attribute names, and value types to make sure they are syntactically valid and internally consistent?

  • A. terraform show
  • B. terraform fmt
  • C. terraform format
  • D. terraform validate

Answer: D

Explanation:
Explanation
The terraform validate command validates the configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc.
Validate runs checks that verify whether a configuration is syntactically valid and internally consistent, regardless of any provided variables or existing state. It is thus primarily useful for general verification of reusable modules, including the correctness of attribute names and value types.
It is safe to run this command automatically, for example as a post-save check in a text editor or as a test step for a re-usable module in a CI system.

 

NEW QUESTION 162
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 _____________.

  • A. Changing Configuration
  • B. Default Configuration
  • C. Partial Configuration
  • D. First Time Configuration
  • E. Incomplete Configuration

Answer: 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:
* Interactively: Terraform will interactively ask you for the required values, unless interactive input is disabled. Terraform will not prompt for optional values.
* File: A configuration file may be specified via the init command line. To specify a file, use the
-backend-config=PATH option when running terraform init. If the file contains secrets it may be kept in a secure data store, such as Vault, in which case it must be downloaded to the local disk before running Terraform.
* Command-line key/value pairs: Key/value pairs can be specified via the init command line. Note that many shells retain command-line flags in a history file, so this isn't recommended for secrets. To specify a single key/value pair, use the -backend-config="KEY=VALUE" option when running terraform init.
https://www.terraform.io/docs/backends/config.html#partial-configuration

 

NEW QUESTION 163
......

TA-002-P exam questions from BraindumpsPrep dumps: https://www.briandumpsprep.com/TA-002-P-prep-exam-braindumps.html (324  Q&As)

Free 2021 HashiCorp Infrastructure Automation TA-002-P dumps are available on Google Drive shared by BraindumpsPrep: https://drive.google.com/open?id=1C25AtU4x8HGUDKUyzSrt--JfHEGKnYvl