Free TA-002-P Exam Braindumps

Pass your HashiCorp Certified: Terraform Associate exam with these free Questions and Answers

Page 24 of 19
QUESTION 111

- (Exam Topic 3)
Dawn has created the below child module. Without changing the module, can she override the instance_type from t2.micro to t2.large form her code while calling this module?
* 1. resource "aws_instance" "myec2"
* 2. {
* 3. ami = "ami-082b5a644766e0e6f"
* 4. instance_type = "t2.micro
* 5. }

  1. A. YES
  2. B. No

Correct Answer: B
As the instance_type is hard-coded in source module, you will not be able to change its value from destination module. Instead of hard-coding you should use variable with default values.

QUESTION 112

- (Exam Topic 4)
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?

  1. A. False
  2. B. True

Correct Answer: B
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

QUESTION 113

- (Exam Topic 3)
Which flag would be used within a Terraform configuration block to identify the specific version of a provider required?

  1. A. required-provider
  2. B. required-version
  3. C. required_providers
  4. D. required_versions

Correct Answer: C
For production use, you should constrain the acceptable provider versions via configuration file to ensure that new versions with breaking changes will not be automatically installed by terraform init in the future.
Example terraform {
required_providers { aws = ">= 2.7.0"
}
}

QUESTION 114

- (Exam Topic 1)
Why would you use the terraform taint command?

  1. A. When you want to force Terraform to destroy a resource on the next apply
  2. B. When you want to force Terraform to destroy and recreate a resource on the next apply
  3. C. When you want Terraform to ignore a resource on the next apply
  4. D. When you want Terraform to destroy all the infrastructure in your workspace

Correct Answer: B
The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.
Reference: https://www.terraform.io/docs/cli/commands/taint.html

QUESTION 115

- (Exam Topic 3)
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.

  1. A. Create individual workspaces for each team , and ask them to share modules across workspaces.
  2. B. Implement a Private module registry in Terraform cloud , and ask teams to reference them.
  3. C. Upgrade to Terraform enterprise , since this is not possible in terraform cloud.
  4. D. Upload the modules in the terraform public module registry , and ask teams to reference them

Correct Answer: B
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

Page 24 of 19

Post your Comments and Discuss HashiCorp TA-002-P exam with other Community members: