Free Terraform-Associate-003 Exam Braindumps

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

Page 4 of 36
QUESTION 11

Which of the following is not a valid source path for specifying a module?

  1. A. source - "github.com/hashicorp/examplePref-ul.0.8M
  2. B. source = "./module?version=vl.6.0"
  3. C. source - "hashicorp/consul/aws"
  4. D. source - "./module"

Correct Answer: B
Terraform modules are referenced by specifying a source location. This location can be a URL or a file path. However, specifying query parameters such as ?version=vl.6.0 directly within the source path is not a valid or supported method for specifying a module version in Terraform. Instead, version constraints are specified using the version argument within the module block, not as part of the source string.
References
= This clarification is based on Terraform's official documentation regarding module usage, which outlines the correct methods for specifying module sources and versions.

QUESTION 12

You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?

  1. A. The Terraform CD needs you to log into Terraform Cloud first
  2. B. Terraform requires you to manually run terraform plan first
  3. C. Terraform needs to install the necessary plugins first
  4. D. Terraform needs you to format your code according to best practices first

Correct Answer: C
The reason why the apply fails after adding a new provider to the configuration and immediately running terraform apply in the CD using the local backend is because Terraform needs to install the necessary plugins first. Terraform providers are plugins that Terraform uses to interact with various cloud services and other APIs. Each provider has a source address that determines where to download it from. When Terraform encounters a new provider in the configuration, it needs to run terraform init first to install the provider plugins in a local directory. Without the plugins, Terraform cannot
communicate with the provider and perform the desired actions. References = [Provider Requirements], [Provider Installation]

QUESTION 13

What does terraform import do?

  1. A. Imports existing resources into the state file
  2. B. Imports all infrastructure from a given cloud provider
  3. C. Imports a new Terraform module
  4. D. Imports clean copies of tainted resources
  5. E. None of the above

Correct Answer: A
The terraform import command is used to import existing infrastructure into your Terraform state. This command takes the existing resource and associates it with a resource defined in your Terraform configuration, updating the state file accordingly. It does not generate configuration for the resource, only the state.

QUESTION 14

Any user can publish modules to the public Terraform Module Registry.

  1. A. True
  2. B. False

Correct Answer: A
The Terraform Registry allows any user to publish and share modules. Published modules support versioning, automatically generate documentation, allow browsing version histories, show examples and READMEs, and more. Public modules are managed via Git and GitHub, and publishing a module takes only a few minutes. Once a module is published, releasing a new version of a module is as simple as pushing a properly formed Git tag1.
References = The information can be verified from the Terraform Registry documentation on Publishing Modules provided by HashiCorp Developer1.

QUESTION 15

How does Terraform determine dependencies between resources?

  1. A. Terraform requires resource dependencies to be defined as modules and sourced in order
  2. B. Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}
  3. C. Terraform requires resources in a configuration to be listed m the order they will be created to determine dependencies
  4. D. Terraform requires all dependencies between resources to be specified using the depends_on parameter

Correct Answer: B
This is how Terraform determines dependencies between resources, by using the references between them in the configuration files and other factors that affect the order of operations.

Page 4 of 36

Post your Comments and Discuss HashiCorp Terraform-Associate-003 exam with other Community members: