
Authentic Best resources for TA-002-P Test Engine Practice Exam
[2022] TA-002-P PDF Questions - Perfect Prospect To Go With Prep4cram Practice Exam
NEW QUESTION 23
You have declared an input variable called environment in your parent module. What must you do to pass the value to a child module in the configuration?
- A. Nothing, child modules inherit variables of parent module
- B. Add node_count = var.node_count
- C. Declare a node_count input variable for child module
- D. Declare the variable in a terraform.tfvars file
Answer: C
NEW QUESTION 24
Terraform providers are always installed from the Internet.
- A. False
- B. True
Answer: A
Explanation:
Explanation
Terraform configurations must declare which providers they require, so that Terraform can install and use them.
Reference: https://www.terraform.io/docs/language/providers/configuration.html
NEW QUESTION 25
By default, a defined provisioner is a creation-time provisioner.
- A. True
- B. False
Answer: A
Explanation:
https://www.terraform.io/docs/provisioners/index.html
NEW QUESTION 26
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 27
You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM, perform terraform apply, and see that your VM was created successfully.
What should you do to delete the newly-created VM with Terraform?
- A. The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
- B. Delete the Terraform state file and execute Terraform apply.
- C. Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.
- D. The Terraform state file only contains the one new VM. Execute terraform destroy.
Answer: D
NEW QUESTION 28
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. No resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 0 changed, 0 destroyed.
- B. 1 resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 1 changed, 0 destroyed.
- C. The instance type will be changed to t2.micro and again will be changed to t2.medium
- D. terraform apply will through an error.
Answer: A
NEW QUESTION 29
Your company has been using Terraform Cloud for a some time now . But every team is creating their own modules , and there is no standardization of the modules , with each team creating the resources in their own unique way . You want to enforce a standardization of the modules across the enterprise . What should be your approach.
- A. Upload the modules in the terraform public module registry , and ask teams to reference them
- B. Implement a Private module registry in Terraform cloud , and ask teams to reference them.
- C. Create individual workspaces for each team , and ask them to share modules across workspaces.
- D. Upgrade to Terraform enterprise , since this is not possible in terraform cloud.
Answer: B
Explanation:
Explanation
Terraform Cloud's private module registry helps you share Terraform modules across your organization. It includes support for module versioning, a searchable and filterable list of available modules, and a configuration designer to help you build new workspaces faster.
By design, the private module registry works much like the public Terraform Registry. If you're already used the public registry, Terraform Cloud's registry will feel familiar.
Understand the different offerings in Terraform OS, Terraform Cloud and Terraform Enterprise. Terraform Cloud's private module registry helps you share Terraform modules across your organization.
https://www.terraform.io/docs/cloud/registry/index.html
https://www.terraform.io/docs/cloud/registry/publish.html
NEW QUESTION 30
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 share modules publicly with any user of Terraform
- D. The ability to tag modules by version or release
Answer: C
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 31
Terraform import command can import resources into modules as well directly into the root of your state.
- A. True
- B. False
Answer: A
Explanation:
Explanation
Import will find the existing resource from ID and import it into your Terraform state at the given ADDRESS.
ADDRESS must be a valid resource address. Because any resource address is valid, the import command can import resources into modules as well directly into the root of your state.
Terraform is able to import existing infrastructure. This allows us take resources we've created by some other means (i.e. via console) and bring it under Terraform management.
This is a great way to slowly transition infrastructure to Terraform.
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. For 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.
As a result of the above command, the resource is recorded in the state file. We can now run terraform plan to see how the configuration compares to the imported resource, and make any adjustments to the configuration to align with the current (or desired) state of the imported object.
https://www.terraform.io/docs/commands/import.html
NEW QUESTION 32
Which of the following terraform subcommands could be used to remove the lock on the state for the current configuration?
- A. Unlock
- B. Removing the lock on a state file is not possible
- C. force-unlock
- D. state-unlock
Answer: C
Explanation:
https://www.terraform.io/docs/commands/force-unlock.html
NEW QUESTION 33
Terraform will sync all resources in state by default for every plan and apply, hence for larger infrastructures this can slow down terraform plan and terraform apply commands?
- A. True
- B. False
Answer: A
Explanation:
For small infrastructures, Terraform can query your providers and sync the latest attributes from all your resources. This is the default behavior of Terraform: for every plan and apply, Terraform will sync all resources in your state.
For larger infrastructures, querying every resource is too slow. Many cloud providers do not provide APIs to query multiple resources at once, and the round trip time for each resource is hundreds of milliseconds. On top of this, cloud providers almost always have API rate limiting so Terraform can only request a certain number of resources in a period of time. Larger users of Terraform make heavy use of the -refresh=false flag as well as the -target flag in order to work around this. In these scenarios, the cached state is treated as the record of truth.
https://www.terraform.io/docs/state/purpose.html
NEW QUESTION 34
Terraform must track metadata such as resource dependencies. Where is this data stored?
- A. workspace
- B. state file
- C. backend
- D. metadata store
Answer: B
Explanation:
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 35
Your company has been using Terraform Cloud for a some time now . But every team is creating their own modules , and there is no standardization of the modules , with each team creating the resources in their own unique way . You want to enforce a standardization of the modules across the enterprise . What should be your approach.
- A. Upload the modules in the terraform public module registry , and ask teams to reference them
- B. Implement a Private module registry in Terraform cloud , and ask teams to reference them.
- C. Create individual workspaces for each team , and ask them to share modules across workspaces.
- D. Upgrade to Terraform enterprise , since this is not possible in terraform cloud.
Answer: B
Explanation:
Terraform Cloud's private module registry helps you share Terraform modules across your organization. It includes support for module versioning, a searchable and filterable list of available modules, and a configuration designer to help you build new workspaces faster.
By design, the private module registry works much like the public Terraform Registry. If you're already used the public registry, Terraform Cloud's registry will feel familiar.
Understand the different offerings in Terraform OS, Terraform Cloud and Terraform Enterprise. Terraform Cloud's private module registry helps you share Terraform modules across your organization.
https://www.terraform.io/docs/cloud/registry/index.html
https://www.terraform.io/docs/cloud/registry/publish.html
NEW QUESTION 36
Terraform works well in Windows but a Windows server is required.
- A. False
- B. True
Answer: A
Explanation:
You may see this
Terraform does not require GO language to be installed as a prerequisite and it does not require a Windows Server as well.
NEW QUESTION 37
You have recently started a new job at a retailer as an engineer. As part of this new role, you have been tasked with evaluating multiple outages that occurred during peak shopping time during the holiday season.
Your investigation found that the team is manually deploying new compute instances and configuring each compute instance manually. This has led to inconsistent configuration between each compute instance.
How would you solve this using infrastructure as code?
- A. Replace the compute instance type with a larger version to reduce the number of required deployments
- B. Implement a checklist that engineers can follow when configuring compute instances
- C. Implement a provisioning pipeline that deploys infrastructure configurations committed to your version control system following code reviews
- D. Implement a ticketing workflow that makes engineers submit a ticket before manually provisioning and configuring a resource
Answer: D
NEW QUESTION 38
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. Run terraform refresh to ensure that the state file has the latest information for existing resources.
- B. Shut down or stop using the resources being imported so no changes are inadvertently missed.
- C. Modify the Terraform state file to add the new resources.
- D. Update the configuration file to include the new resources.
Answer: D
Explanation:
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 39
A user creates three workspaces from the command line - prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?
- A. terraform workspace switch dev
Explanation
The terraform workspace select command is used to choose a different workspace to use for further operations. https://www.terraform.io/docs/commands/workspace/select.html - B. terraform workspace select dev
- C. terraform workspace -switch dev
- D. terraform workspace dev
Answer: B
NEW QUESTION 40
Which of the following state management command allow you to retrieve a list of resources that are part of the state file?
- A. terraform state view
- B. terraform view
- C. terraform state list
- D. terraform list
Answer: C
Explanation:
Explanation
The terraform state list command is used to list resources within a Terraform state.
Usage: terraform state list [options] [address...]
The command will list all resources in the state file matching the given addresses (if any). If no addresses are given, all resources are listed.
https://www.terraform.io/docs/commands/state/list.html
NEW QUESTION 41
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 42
......
Best updated resource for TA-002-P Online Practice Exam: https://pass4sure.prep4cram.com/TA-002-P-exam-cram.html

