[2022] TA-002-P by HashiCorp Infrastructure Automation Actual Free Exam Practice Test [Q67-Q92]

Share

[2022]  TA-002-P by HashiCorp Infrastructure Automation Actual Free Exam Practice Test

Free HashiCorp Infrastructure Automation TA-002-P Exam Question


Understanding functional and technical aspects of HashiCorp Certified: Terraform Associate TA-002-P Professional Exam Object Management

The following will be discussed in HASHICORP TA-002 exam dumps:

  • Express secure secret injection best practice
  • Exhibit use of variables and outputs
  • Design and distinguish resource and data configuration
  • Use Terraform built-in functions to write configuration
  • Utilize resource addressing and resource parameters to connect resources
  • Learn the application of the collection and structural types
  • Configure resource using a dynamic block
  • Specify built-in dependency management

 

NEW QUESTION 67
Which of the following value will be accepted for my_var?
1. variable "my_var"
2. {
3. type = string
4. }

  • A. None of the above
  • B. "15"
  • C. 0
  • D. Both A and B

Answer: D

Explanation:
Explanation
The Terraform language will automatically convert number and bool values to string values when needed, and vice-versa as long as the string contains a valid representation of a number or boolean value.
Example
* true converts to "true", and vice-versa
* false converts to "false", and vice-versa
* 15 converts to "15", and vice-versa
Where possible, Terraform automatically converts values from one type to another in order to produce the expected type. If this isn't possible, Terraform will produce a type mismatch error and you must update the configuration with a more suitable expression.
https://www.terraform.io/docs/configuration/expressions.html#type-conversion

 

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

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

Answer: A,B

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

 

NEW QUESTION 69
Which of the below are paid features of Terraform Cloud?

  • A. Full API Coverage
  • B. Private Module Registry
  • C. Secure variable Storage
  • D. Cost Estimation
  • E. Sentinel policies
  • F. Roles/ Team management

Answer: D,E,F

Explanation:
Explanation
https://www.hashicorp.com/products/terraform/pricing/

 

NEW QUESTION 70
When Terraform needs to be installed in a location where it does not have internet access to download the installer and upgrades, the installation is generally known as to be __________.

  • A. a private install
  • B. non-traditional
  • C. air-gapped
  • D. disconnected

Answer: B

Explanation:
Explanation
A Terraform Enterprise install that is provisioned on a network that does not have Internet access is generally known as an air-gapped install. These types of installs require you to pull updates, providers, etc. from external sources vs. being able to download them directly.

 

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

  • A. False
  • B. True

Answer: A

Explanation:
Explanation
Explanation/Reference: https://www.terraform.io/docs/extend/guides/v1-upgrade-guide.html

 

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

  • A. False
  • B. True

Answer: A

 

NEW QUESTION 73
What value does the Terraform Cloud/Terraform Enterprise private module registry provide over the public Terraform Module Registry?

  • A. The ability to share modules with public Terraform users and members of Terraform Enterprise Organizations
  • B. The ability to restrict modules to members of Terraform Cloud or Enterprise organizations
  • C. The ability to tag modules by version or release
  • D. The ability to share modules publicly with any user of Terraform

Answer: D

Explanation:
Explanation
Terraform Registry is an index of modules shared publicly using this protocol. This public registry is the easiest way to get started with Terraform and find modules created by others in the community.
Reference: https://www.terraform.io/docs/language/modules/sources.html

 

NEW QUESTION 74
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:
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 75
What is the standard workflow that a developer follows while working with terraform open source version?

  • A. Write terraform code , and run terraform push , to update the terraform state to the remote repo , which in turn will take care of the next steps.
  • B. Write the terraform code on the developer machine , run terraform plan to check the changes , and run terraform apply to provision the infra.
  • C. Run terraform destroy first since you need to start from fresh every time , before running terraform apply.
  • D. Run terraform refresh to update the terraform state , then write the terraform code , and finally run terraform apply.

Answer: B

Explanation:
You do not need to run terraform refresh as terraform plan implicitly will run terraform refresh.
https://www.terraform.io/guides/core-workflow.html

 

NEW QUESTION 76
Every region in AWS has a different AMI ID for Linux and these are keep on changing. What is the best approach to create the EC2 instances that can deal with different AMI IDs based on regions?

  • A. Create different configuration file for different region.
  • B. Use data source aws_ami.
  • C. None of the above
  • D. Create a map of region to ami id.

Answer: B

Explanation:
Explanation
https://www.terraform.io/docs/configuration/data-sources.html

 

NEW QUESTION 77
In regards to deploying resources in multi-cloud environments, what are some of the benefits of using Terraform rather than a provider's native tooling? (select three)

  • A. Terraform can manage cross-cloud dependencies.
  • B. Terraform simplifies management and orchestration, helping operators build large-scale, multi-cloud infrastructure.
  • C. Terraform is not cloud-agnostic and can be used to deploy resources across a single public cloud.
  • D. Terraform can help businesses deploy applications on multiple clouds and on-premises infrastructure.

Answer: A,B,D

Explanation:
Explanation
Terraform is cloud-agnostic and allows a single configuration to be used to manage multiple providers, and to even handle cross-cloud dependencies. This simplifies management and orchestration, helping operators build large-scale multi-cloud infrastructures.
https://www.terraform.io/intro/use-cases.html

 

NEW QUESTION 78
What is the result of the following terraform function call?

  • A. hello
  • B. goodbye
    Explanation
    https://www.terraform.io/docs/configuration/functions/lookup.html
  • C. what?

Answer: C

 

NEW QUESTION 79
You want terraform plan and terraform apply to be executed in Terraform Cloud's run environment but the output is to be streamed locally. Which one of the below you will choose?

  • A. Remote Backends.
  • B. This can be done using any of the local or remote backends.
  • C. Local Backends.
  • D. Terraform Backends.

Answer: A

Explanation:
Explanation
When using full remote operations, operations like terraform plan or terraform apply can be executed in Terraform Cloud's run environment, with log output streaming to the local terminal. Remote plans and applies use variable values from the associated Terraform Cloud workspace.
Terraform Cloud can also be used with local operations, in which case only state is stored in the Terraform Cloud backend.
https://www.terraform.io/docs/backends/types/remote.html

 

NEW QUESTION 80
Which of the below configuration file formats are supported by Terraform? (Select TWO)

  • A. YAML
  • B. Node
  • C. HCL
  • D. JSON
  • E. Go

Answer: C,D

Explanation:
Terraform supports both HashiCorp Configuration Language (HCL) and JSON formats for configurations.
https://www.terraform.io/docs/configuration/

 

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

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

Answer: D

Explanation:
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 82
Terraform must track metadata such as resource dependencies. Where is this data stored?

  • A. metadata store
  • B. backend
  • C. workspace
  • D. state file

Answer: D

Explanation:
Terraform typically uses the configuration to determine dependency order. However, when you delete a resource from a Terraform configuration, Terraform must know how to delete that resource. Terraform can see that a mapping exists for a resource not in your configuration and plan to destroy. However, since the configuration no longer exists, the order cannot be determined from the configuration alone.
To ensure correct operation, Terraform retains a copy of the most recent set of dependencies within the state. Now Terraform can still determine the correct order for destruction from the state when you delete one or more items from the configuration.
https://www.terraform.io/docs/state/purpose.html#metadata

 

NEW QUESTION 83
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 destroyed and recreated.
  • B. The resource will be created.
  • C. The resource will be updated in place.
  • D. Terraform can't determine how to proceed due to a problem with the state file.

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 84
A user has created a module called "my_test_module" and committed it to GitHub. Over time, several commits have been made with updates to the module, each tagged in GitHub with an incremental version number. Which of the following lines would be required in a module configuration block in terraform to select tagged version v1.0.4?

  • A. source = "git::https://example.com/my_test_module.git&ref=v1.0.4"
  • B. source = "git::https://example.com/my_test_module.git?ref=v1.0.4"
    Explanation
    https://www.terraform.io/docs/modules/sources.html#selecting-a-revision
  • C. source = "git::https://example.com/my_test_module.git@tag=v1.0.4"
  • D. source = "git::https://example.com/my_test_module.git#tag=v1.0.4"

Answer: B

 

NEW QUESTION 85
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. 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. it is automatically deleted

Answer: A

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 86
State locking does not happen automatically and must be specified at run

  • A. False
  • B. True

Answer: A

Explanation:
Explanation
State locking happens automatically on all operations that could write state.
https://www.terraform.io/docs/state/locking.html

 

NEW QUESTION 87
What command should you run to display all workspaces for the current configuration?

  • A. terraform show workspace
  • B. terraform workspace list
  • C. terraform workspace show
  • D. terraform workspace

Answer: B

Explanation:
terraform workspace list
The command will list all existing workspaces.
Reference: https://www.terraform.io/docs/cli/commands/workspace/list.html

 

NEW QUESTION 88
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:
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 89
You have created a custom variable definition file my_vars.tfvars. How will you use it for provisioning infrastructure?

  • A. terraform apply -var-state-file ="my_vars.tfvars"
  • B. terraform apply -var-file="my_vars.tfvars"
  • C. terraform plan -var-file="my_vars.tfvar"
  • D. terraform apply var-file="my_vars.tfvars"

Answer: B

Explanation:
To set lots of variables, it is more convenient to specify their values in a variable definitions file (with a filename ending in either .tfvars or .tfvars.json) and then specify that file on the command line with -var-file:
terraform apply -var-file="my_vars.tfvars"
https://www.terraform.io/docs/configuration/variables.html#variable-definitions-tfvars-files

 

NEW QUESTION 90
Which of the following best describes a Terraform provider?

  • A. A container for multiple resources that are used together.
  • B. Serves as a parameter for a Terraform module that allows a module to be customized.
  • C. Describes an infrastructure object, such as a virtual network, compute instance, or other components.
  • D. A plugin that Terraform uses to translate the API interactions with the service or provider.

Answer: D

Explanation:
A provider is responsible for understanding API interactions and exposing resources. Providers generally are an IaaS (e.g. Alibaba Cloud, AWS, GCP, Microsoft Azure, OpenStack), PaaS (e.g. Heroku), or SaaS services (e.g. Terraform Cloud, DNSimple, Cloudflare).
https://www.terraform.io/docs/providers/index.html

 

NEW QUESTION 91
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 92
......

HashiCorp TA-002-P Actual Questions and Braindumps: https://www.briandumpsprep.com/TA-002-P-prep-exam-braindumps.html

TA-002-P dumps & HashiCorp Infrastructure Automation sure practice dumps: https://drive.google.com/open?id=1Nlwlk-Pp94h03t5mzlB7xXSdh56l0qZS