
Latest Feb 24, 2023 Real TA-002-P Exam Dumps Questions Valid TA-002-P Dumps PDF
HashiCorp TA-002-P Exam Dumps - PDF Questions and Testing Engine
Aruba Networks Certified: Mobility Associate-Professional Exam Certified Professional salary
The estimated average salary of HashiCorp Certified: Terraform Associate TA-002-P Professional Exam is listed below:
- England: 71,460 POUND
- India: 7,199,4 INR
- Europe: 88,032 EURO
- United States: 100,146 USD
These salaries are calculated at the time of writing according to the currency rates.
Sample Questions
During a terraform plan, a resource is successfully created but eventually fails during provisioning. What happens to the resource?
- Terraform attempts to provision the resource up to three times before exiting with an error
- The resource is marked as tainted
- It is automatically deleted
- The terraform plan is rolled back and all provisioned resources are removed
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.
True or False? When using the Terraform provider for Vault, the tight integration between these HashiCorp tools provides the ability to mask secrets in the terraform plan and state files.
- False
- True
Explanation
Currently, Terraform has no mechanism to redact or protect secrets that are returned via data sources, so secrets read via this provider will be persisted into the Terraform state, into any plan files, and in some cases in the console output produced while planning and applying. These artifacts must, therefore, all be protected accordingly.
HashiCorp TA-002-P Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
| Topic 5 |
|
| Topic 6 |
|
| Topic 7 |
|
| Topic 8 |
|
| Topic 9 |
|
| Topic 10 |
|
| Topic 11 |
|
| Topic 12 |
|
| Topic 13 |
|
NEW QUESTION 101
A single terraform resource file that defines an aws_instance resource can simply be renamed to vsphere_virtual_machine in order to switch cloud providers.
- A. True
- B. False
Answer: B
Explanation:
Explanation
Every provider has its own required and allowed declarations none of which match between cloud providers.
NEW QUESTION 102
John wants to use two different regions to deploy two different EC2 instances. He has specified two provider
blocks in his providers.tf file.
provider "aws" { region = "us-east-1" }
provider "aws" { region = "us-west-2" }
When he run terraform plan he encountered an error. How to fix this?
- A. It can not be fixed
- B. Use alias for region = "us-west-2"
- C. Use another provider version
- D. Use default keyword with region = "us-east-1"
Answer: B
NEW QUESTION 103
terraform validate validate validates that your infrastructure matches the Terraform state file.
- A. True
- B. False
Answer: B
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 correctness of attribute names and value types. Source:
https://www.terraform.io/cli/commands/validate
NEW QUESTION 104
True or False? When using the Terraform provider for Vault, the tight integration between these HashiCorp
tools provides the ability to mask secrets in the terraform plan and state files.
- A. True
- B. False
Answer: B
Explanation:
Explanation
Currently, Terraform has no mechanism to redact or protect secrets that are returned via data sources, so
secrets read via this provider will be persisted into the Terraform state, into any plan files, and in some cases in
the console output produced while planning and applying. These artifacts must, therefore, all be protected
accordingly.
NEW QUESTION 105
Which command lets you experiment with Terraform's built-in functions?
- A. terraform test
- B. terraform console
- C. terraform validate
- D. terraform env
Answer: B
Explanation:
Explanation
https://www.terraform.io/cli/commands/console
NEW QUESTION 106
What are some of the problems of how infrastructure was traditionally managed before Infrastructure as Code? (select three)
- A. Traditionally managed infrastructure can't keep up with cyclic or elastic applications
- B. Requests for infrastructure or hardware required a ticket, increasing the time required to deploy applications
- C. Pointing and clicking in a management console is a scalable approach and reduces human error as businesses are moving to a multi-cloud deployment model
- D. Traditional deployment methods are not able to meet the demands of the modern business where resources tend to live days to weeks, rather than months to years
Answer: A,B,D
Explanation:
Businesses are making a transition where traditionally-managed infrastructure can no longer meet the demands of today's businesses. IT organizations are quickly adopting the public cloud, which is predominantly API-driven. To meet customer demands and save costs, application teams are architecting their applications to support a much higher level of elasticity, supporting technology like containers and public cloud resources. These resources may only live for a matter of hours; therefore the traditional method of raising a ticket to request resources is no longer a viable option Pointing and clicking in a management console is NOT scale and increases the change of human error.
NEW QUESTION 107
Refer to the below code where developer is outputting the value of the database password but has used sensitive parameter to hide the output value in the CLI.
output "db_password" { value = aws_db_instance.db.password description = "The password for logging in to the database." sensitive = true} Since sensitive is set to true, the value associated with db password will not be present in state file as plain-text?
- A. True
- B. False
Answer: B
Explanation:
Sensitive output values are still recorded in the state, and so will be visible to anyone who is able to access the state data.
NEW QUESTION 108
Which parameters does terraform import require? Choose two correct answers.
- A. Resource address
- B. Provider
- C. Resource ID
- D. Path
Answer: A,C
NEW QUESTION 109
Multiple provider instances blocks for AWS can be part of 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 110
John is writing a module and within the module, there are multiple places where he has to use the same conditional expression but he wants to avoid repeating the same values or expressions multiple times in a configuration,. What is a better approach to dealing with this?
- A. Variables
- B. Expressions
- C. Local Values
- D. Functions
Answer: C
Explanation:
Explanation
A local value assigns a name to an expression, allowing it to be used multiple times within a module without repeating it.
https://www.terraform.io/docs/configuration/locals.html
NEW QUESTION 111
Which of the following statements about Terraform modules is not true?
- A. Modules must be publicly accessible
- B. Modules can call other modules
- C. Modules can be called multiple times
- D. Module is a container for one or more resources
Answer: A
Explanation:
Explanation
In addition to modules from the local filesystem, Terraform can load modules from a public or private registry.
Also, members of your organization might produce modules specifically crafted for your own infrastructure
needs. Source: https://www.terraform.io/language/modules
NEW QUESTION 112
When using providers that require the retrieval of data, such as the HashiCorp Vault provider, in what phase does Terraform actually retrieve the data required?
- A. terraform apply
- B. terraform init
- C. terraform delete
- D. terraform plan
Answer: B
NEW QUESTION 113
True or False: A list(...) contain a number of values of the same type while an object(...) can contain a number of values of different types.
- A. True
- B. False
Answer: A
Explanation:
Collection Types
A collection type allows multiple values of one other type to be grouped together as a single value. The type of value within a collection is called its element type. All collection types must have an element type, which is provided as the argument to their constructor.
For example, the type list(string) means "list of strings", which is a different type than list(number), a list of numbers. All elements of a collection must always be of the same type.
The three kinds of collection type in the Terraform language are:
* list(...): a sequence of values identified by consecutive whole numbers starting with zero.
The keyword list is a shorthand for list(any), which accepts any element type as long as every element is the same type. This is for compatibility with older configurations; for new code, we recommend using the full form.
* map(...): a collection of values where each is identified by a string label.
The keyword map is a shorthand for map(any), which accepts any element type as long as every element is the same type. This is for compatibility with older configurations; for new code, we recommend using the full form.
* set(...): a collection of unique values that do not have any secondary identifiers or ordering.
https://www.terraform.io/docs/configuration/types.html
Structural Types
A structural type allows multiple values of several distinct types to be grouped together as a single value. Structural types require a schema as an argument, to specify which types are allowed for which elements.
The two kinds of structural type in the Terraform language are:
* object(...): a collection of named attributes that each have their own type.
The schema for object types is { <KEY> = <TYPE>, <KEY> = <TYPE>, ... } - a pair of curly braces containing a comma-separated series of <KEY> = <TYPE> pairs. Values that match the object type must contain all of the specified keys, and the value for each key must match its specified type. (Values with additional keys can still match an object type, but the extra attributes are discarded during type conversion.)
* tuple(...): a sequence of elements identified by consecutive whole numbers starting with zero, where each element has its own type.
The schema for tuple types is [<TYPE>, <TYPE>, ...] - a pair of square brackets containing a comma-separated series of types. Values that match the tuple type must have exactly the same number of elements (no more and no fewer), and the value in each position must match the specified type for that position.
For example: an object type of object({ name=string, age=number }) would match a value like the following:
{
name = "John"
age = 52
}
Also, an object type of object({ id=string, cidr_block=string }) would match the object produced by a reference to an aws_vpc resource, like aws_vpc.example_vpc; although the resource has additional attributes, they would be discarded during type conversion.
Finally, a tuple type of tuple([string, number, bool]) would match a value like the following:
["a", 15, true]
https://www.terraform.io/docs/configuration/types.html
NEW QUESTION 114
What is the command you can use to set an environment variable named "var1"of type String?
- A. set TF_VAR_var1
- B. variable "var1" { type = "string"}
- C. export TF_VAR_VAR1
- D. export TF_VAR_var1
Answer: D
Explanation:
The environment variable must be in the format TF_VAR_name, so for the
NEW QUESTION 115
When should you use the force-unlock command?
- A. Automatic unlocking failed
- B. Your apply failed due to a state lock
- C. You see a status message that you cannot acquire the lock
- D. You have a high priority change
Answer: A
Explanation:
Manually unlock the state for the defined configuration.
NEW QUESTION 116
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: C
NEW QUESTION 117
During a terraform plan, a resource is successfully created but eventually fails during provisioning. What happens to the resource?
- A. Terraform attempts to provision the resource up to three times before exiting with an error
- B. the resource is marked as tainted
- C. the terraform plan is rolled back and all provisioned resources are removed
- D. it is automatically deleted
Answer: B
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 118
If writing Terraform code that adheres to the Terraform style conventions, how would you properly indent each nesting level compared to the one above it?
- A. With three spaces
- B. With four spaces
- C. With two spaces
- D. With a tab
Answer: C
NEW QUESTION 119
You want to use terraform import to start managing infrastructure that was not originally provisioned through infrastructure as code. Before you can import the resource's current state, what must you do in order to prepare to manage these resources using Terraform?
- A. Update the configuration file to include the new resources.
- B. Run terraform refresh to ensure that the state file has the latest information for existing resources.
- C. Shut down or stop using the resources being imported so no changes are inadvertently missed.
- D. Modify the Terraform state file to add the new resources.
Answer: A
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.
The terraform import command is used to import existing infrastructure.
To import a resource, first write a resource block for it in our configuration, establishing the name by which it will be known to Terraform.
Example:
resource "aws_instance" "import_example" {
# ...instance configuration...
}
Now terraform import can be run to attach an existing instance to this resource configuration.
$ terraform import aws_instance.import_example i-03efafa258104165f
aws_instance.import_example: Importing from ID "i-03efafa258104165f"...
aws_instance.import_example: Import complete!
Imported aws_instance (ID: i-03efafa258104165f)
aws_instance.import_example: Refreshing state... (ID: i-03efafa258104165f) Import successful!
The resources that were imported are shown above. These resources are now in your Terraform state and will henceforth be managed by Terraform.
This command locates the AWS instance with ID i-03efafa258104165f (which has been created outside Terraform) and attaches its existing settings, as described by the EC2 API, to the name aws_instance.import_example in the Terraform state.
NEW QUESTION 120
A Terraform output that sets the ''sensitive'' argument to true will not store that value in the state file.
- A. True
- B. False
Answer: B
NEW QUESTION 121
Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?
- A. terraform fmt
- B. terraform destroy
- C. terraform taint
- D. terraform refresh
Answer: C
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 122
What is not processed when running a terraform refresh?
- A. Credentials
- B. Configuration file
- C. State file
- D. Cloud provider
Answer: A,D
Explanation:
Reference: https://www.terraform.io/docs/cli/commands/refresh.html
NEW QUESTION 123
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. Sentinel
- B. Module registry
- C. Workspaces
- D. Functions
Answer: A
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 124
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 validate null_resource.run_script
- B. terraform plan -target=null_resource.run_script
- C. terraform apply -target=null_resource.run_script
- D. terraform taint null_resource.run_script
Answer: D
NEW QUESTION 125
Which provisioner invokes a process on the resource created by Terraform?
- A. file
- B. null-exec
- C. remote-exec
- D. local-exec
Answer: C
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 126
......
Reliable HashiCorp Infrastructure Automation TA-002-P Dumps PDF Feb 24, 2023 Recently Updated Questions: https://www.dumpexams.com/TA-002-P-real-answers.html
Latest TA-002-P Exam Dumps for Pass Guaranteed: https://drive.google.com/open?id=17Xf3CUj-lnI9q2X9KL2jkKR91A65nLN7