
Best Way To Study For HashiCorp TA-002-P Exam Brilliant TA-002-P Exam Questions PDF
Updated Verified Pass TA-002-P Exam - Real Questions and Answers
NEW QUESTION 148
Terraform works well in Windows but a Windows server is required.
- A. False
- B. True
Answer: A
Explanation:
You may see this
NEW QUESTION 149
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. Backends
- B. Repositories
- C. Workspaces
- D. Environment Variables
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 150
During a terraform plan, a resource is successfully created but eventually fails during provisioning. What happens to the resource?
- A. the resource is marked as tainted
- B. it is automatically deleted
- C. Terraform attempts to provision the resource up to three times before exiting with an error
- D. the terraform plan is rolled back and all provisioned resources are removed
Answer: A
Explanation:
If a resource successfully creates but fails during provisioning, Terraform will error and mark the resource as "tainted". A resource that is tainted has been physically created, but can't be considered safe to use since provisioning failed. Terraform also does not automatically roll back and destroy the resource during the apply when the failure happens, because that would go against the execution plan: the execution plan would've said a resource will be created, but does not say it will ever be deleted.
NEW QUESTION 151
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. label
- B. multi
- C. alias
- D. version
Answer: C
Explanation:
Explanation
https://www.terraform.io/docs/configuration/providers.html#alias-multiple-providerinstances
NEW QUESTION 152
What does terraform refresh modify?
- A. Your Terraform configuration
- B. Your cloud infrastructure
- C. Your Terraform plan
- D. Your state file
Answer: D
NEW QUESTION 153
You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?
- A. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)
- B. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
- C. Designate one person in each team to review and format everyone's code
- D. Run the terraform fmt command during the code linting phase of your CI/CD process
Answer: A
Explanation:
Indent two spaces for each nesting level.
When multiple arguments with single-line values appear on consecutive lines at the same nesting level, align their equals signs.
NEW QUESTION 154
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. Existence of any provider plugins found locally in the working directory.
- C. Explicit use of a provider block in configuration, optionally including a version constraint.
- D. Use of any resource belonging to a particular provider in a resource or data block in configuration.
Answer: A,C,D
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 155
Which of the below command will upgrade the provider version to the latest acceptable one?
- A. terraform plan upgrade
- B. terraform init -update
- C. terraform init -upgrade
- D. terraform provider -upgrade
Answer: C
Explanation:
Explanation
To upgrade to the latest acceptable version of each provider, run terraform init -upgrade. This command also upgrades to the latest versions of all Terraform modules.
https://www.terraform.io/docs/configuration/providers.html
NEW QUESTION 156
Which of the below command will upgrade the provider version to the latest acceptable one?
- A. terraform plan upgrade
- B. terraform init -update
- C. terraform init -upgrade
- D. terraform provider -upgrade
Answer: C
Explanation:
To upgrade to the latest acceptable version of each provider, run terraform init -upgrade. This command also upgrades to the latest versions of all Terraform modules.
https://www.terraform.io/docs/configuration/providers.html
NEW QUESTION 157
While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax can Terraform are expressed in?
- A. YAML
- B. TypeScript
- C. JSON
- D. XML
Answer: C
Explanation:
The constructs in the Terraform language can also be expressed in JSON syntax, which is harder for humans to read and edit but easier to generate and parse programmatically.
NEW QUESTION 158
Open source Terraform can only import publicly-accessible and open-source modules.
- A. False
- B. True
Answer: A
NEW QUESTION 159
Which option can not be used to keep secrets out of Terraform configuration files?
- A. Environment variables
- B. secure string
- C. A Terraform provider
- D. A -var flag
Answer: D
NEW QUESTION 160
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 plan -target=null_resource.run_script
- B. terraform validate null_resource.run_script
- C. terraform taint null_resource.run_script
- D. terraform apply -target=null_resource.run_script
Answer: C
NEW QUESTION 161
Which of the following is considered a Terraform plugin?
- A. Terraform language
- B. Terraform tooling
- C. Terraform provider
- D. Terraform logic
Answer: C
Explanation:
Explanation
Terraform is built on a plugin-based architecture. All providers and provisioners that are used in Terraform configurations are plugins, even the core types such as AWS and Heroku. Users of Terraform are able to write new plugins in order to support new functionality in Terraform.
https://www.terraform.io/docs/plugins/basics.html
NEW QUESTION 162
Terraform variables and outputs that set the "description" argument will store that description in the state file.
- A. False
- B. True
Answer: A
NEW QUESTION 163
Which of the following statements best describes the Terraform list(...) type?
- A. a sequence of values identified by consecutive whole numbers starting with zero.
- B. a collection of values where each is identified by a string label.
- C. a collection of unique values that do not have any secondary identifiers or ordering.
- D. a collection of named attributes that each have their own type.
Answer: A
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 164
......
Updated PDF (New 2022) Actual HashiCorp TA-002-P Exam Questions: https://certkingdom.pass4surequiz.com/TA-002-P-exam-quiz.html