
Use Real TA-002-P - 100% Cover Real Exam Questions [Aug-2021]
Dumps Brief Outline Of The TA-002-P Exam - PracticeMaterial
NEW QUESTION 114
Once a resource is marked as tainted, the next plan will show that the resource will be _________ and ___________ and the next apply will implement this change.
- A. destroyed and recreated
- B. destroyed and not recreated
- C. recreated and tainted
- D. tainted and not destroyed
Answer: A
NEW QUESTION 115
If a module uses a local variable, you can expose that value with a terraform output.
- A. True
- B. False
Answer: A
Explanation:
Output values are like function return values.
NEW QUESTION 116
In the example below, the depends_on argument creates what type of dependency?
- A. internal dependency
- B. explicit dependency
- C. implicit dependency
- D. non-dependency resource
Answer: D
NEW QUESTION 117
During a terraform plan, a resource is successfully created but eventually fails during provisioning. What happens to the resource?
- A. it is automatically deleted
- B. Terraform attempts to provision the resource up to three times before exiting with an error
- C. the terraform plan is rolled back and all provisioned resources are removed
- D. the resource is marked as tainted
Answer: D
Explanation:
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
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 119
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 120
After executing a terraform apply, you notice that a resource has a tilde (~) next to it. What does this infer?
- A. The resource will be created.
- B. Terraform can't determine how to proceed due to a problem with the state file.
- C. The resource will be updated in place.
- D. The resource will be destroyed and recreated.
Answer: C
Explanation:
Explanation
The prefix -/+ means that Terraform will destroy and recreate the resource, rather than updating it in-place.
The prefix ~ means that some attributes and resources can be updated in-place.
$ terraform apply
aws_instance.example: Refreshing state... [id=i-0bbf06244e44211d1]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# aws_instance.example must be replaced
-/+ resource "aws_instance" "example" {
~ ami = "ami-2757f631" -> "ami-b374d5a5" # forces replacement
~ arn = "arn:aws:ec2:us-east-1:130490850807:instance/i-0bbf06244e44211d1" -> (known after apply)
~ associate_public_ip_address = true -> (known after apply)
~ availability_zone = "us-east-1c" -> (known after apply)
~ cpu_core_count = 1 -> (known after apply)
~ cpu_threads_per_core = 1 -> (known after apply)
- disable_api_termination = false -> null
- ebs_optimized = false -> null
get_password_data = false
+ host_id = (known after apply)
~ id = "i-0bbf06244e44211d1" -> (known after apply)
~ instance_state = "running" -> (known after apply)
instance_type = "t2.micro"
~ ipv6_address_count = 0 -> (known after apply)
~ ipv6_addresses = [] -> (known after apply)
+ key_name = (known after apply)
- monitoring = false -> null
+ network_interface_id = (known after apply)
+ password_data = (known after apply)
+ placement_group = (known after apply)
~ primary_network_interface_id = "eni-0f1ce5bdae258b015" -> (known after apply)
~ private_dns = "ip-172-31-61-141.ec2.internal" -> (known after apply)
~ private_ip = "172.31.61.141" -> (known after apply)
~ public_dns = "ec2-54-166-19-244.compute-1.amazonaws.com" -> (known after apply)
~ public_ip = "54.166.19.244" -> (known after apply)
~ security_groups = [
- "default",
] -> (known after apply)
source_dest_check = true
~ subnet_id = "subnet-1facdf35" -> (known after apply)
~ tenancy = "default" -> (known after apply)
~ volume_tags = {} -> (known after apply)
~ vpc_security_group_ids = [
- "sg-5255f429",
] -> (known after apply)
- credit_specification {
- cpu_credits = "standard" -> null
}
+ ebs_block_device {
+ delete_on_termination = (known after apply)
+ device_name = (known after apply)
+ encrypted = (known after apply)
+ iops = (known after apply)
+ snapshot_id = (known after apply)
+ volume_id = (known after apply)
+ volume_size = (known after apply)
+ volume_type = (known after apply)
}
+ ephemeral_block_device {
+ device_name = (known after apply)
+ no_device = (known after apply)
+ virtual_name = (known after apply)
}
+ network_interface {
+ delete_on_termination = (known after apply)
+ device_index = (known after apply)
+ network_interface_id = (known after apply)
}
~ root_block_device {
~ delete_on_termination = true -> (known after apply)
~ iops = 100 -> (known after apply)
~ volume_id = "vol-0079e485d9e28a8e5" -> (known after apply)
~ volume_size = 8 -> (known after apply)
~ volume_type = "gp2" -> (known after apply)
}
}
Plan: 1 to add, 0 to change, 1 to destroy.
NEW QUESTION 121
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 a tab
- C. With two spaces
- D. With four spaces
Answer: C
NEW QUESTION 122
State locking does not happen automatically and must be specified at run
- A. False
- B. True
Answer: A
Explanation:
State locking happens automatically on all operations that could write state.
https://www.terraform.io/docs/state/locking.html
NEW QUESTION 123
What feature of Terraform Cloud and/or Terraform Enterprise can you publish and maintain a set of custom modules which can be used within your organization?
- A. remote runs
- B. custom VCS integration
- C. Terraform registry
- D. private module registry
Answer: D
NEW QUESTION 124
What is the result of the following terraform function call?
- A. False
- B. True
Answer: A
Explanation:
Explanation
https://www.terraform.io/docs/configuration/functions/index.html
NEW QUESTION 125
Your developers are facing a lot of problem while writing complex expressions involving difficult interpolations . They have to run the terraform plan every time and check whether there are errors , and also check terraform apply to print the value as a temporary output for debugging purposes. What should be done to avoid this?
- A. Use terraform console command to have an interactive UI with full access to the underlying terraform state to run your interpolations , and debug at real-time.
- B. Use terraform console command to have an interactive UI , but you can only use it with local state , and it does not work with remote state.
- C. Use terraform zipmap function , it will be able to easily do the interpolations without complex code.
- D. Add a breakpoint in your code, using the watch keyword , and output the value to console for temporary debugging.
Answer: A
Explanation:
Explanation
The terraform console command provides an interactive console for evaluating expressions. This is useful for testing interpolations before using them in configurations, and for interacting with any values currently saved in state.
https://www.terraform.io/docs/commands/console.html
NEW QUESTION 126
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. False
- B. 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.
Answer: A
NEW QUESTION 127
Which option can not be used to keep secrets out of Terraform configuration files?
- A. Environment variables
- B. A -var flag
- C. A Terraform provider
- D. secure string
Answer: B
Explanation:
Explanation/Reference: https://secrethub.io/blog/secret-management-for-terraform/
NEW QUESTION 128
In order to make a Terraform configuration file dynamic and/or reusable, static values should be converted to use what?
- A. Input Parameters
- B. Output Value
- C. Module
- D. Regular Expressions
Answer: A
Explanation:
Input variables serve as parameters for a Terraform module, allowing aspects of the module to be customized without altering the module's own source code, and allowing modules to be shared between different configurations.
https://www.terraform.io/docs/configuration/variables.html
NEW QUESTION 129
......
Certification Training for TA-002-P Exam Dumps Test Engine: https://www.practicematerial.com/TA-002-P-exam-materials.html
TA-002-P Training & Certification Get Latest HashiCorp Infrastructure Automation : https://drive.google.com/open?id=10DlnO6-HqgZZMjWLd4LdF-6cNWwBPwpC

