Prepare for the HashiCorp Certified: Terraform Associate (003) exam with our extensive collection of questions and answers. These practice Q&A are updated according to the latest syllabus, providing you with the tools needed to review and test your knowledge.
QA4Exam focus on the latest syllabus and exam objectives, our practice Q&A are designed to help you identify key topics and solidify your understanding. By focusing on the core curriculum, These Questions & Answers helps you cover all the essential topics, ensuring you're well-prepared for every section of the exam. Each question comes with a detailed explanation, offering valuable insights and helping you to learn from your mistakes. Whether you're looking to assess your progress or dive deeper into complex topics, our updated Q&A will provide the support you need to confidently approach the HashiCorp Terraform-Associate-003 exam and achieve success.
A module can always refer to all variables declared in its parent module.
A module cannot always refer to all variables declared in its parent module, as it needs to explicitly declare input variables and assign values to them from the parent module's arguments. A module cannot access the parent module's variables directly, unless they are passed as input arguments.
You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.
To import existing resources into Terraform, you need to do two things1:
Write a resource configuration block for each resource, matching the type and name used in your state file.
Run terraform import for each resource, specifying its address and ID. There is no such command as terraform Import-gcp, and provisioning new VMs with the same names will not import them into Terraform.
Which Terraform command checks that your configuration syntax is correct?
The terraform validate command is used to check that your Terraform configuration files are syntactically valid and internally consistent. It is a useful command for ensuring your Terraform code is error-free before applying any changes to your infrastructure.
If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.
Detailed
Rationale for Correct Answer (True):
Variables without defaults are required inputs. If the calling module doesn't supply a value, Terraform will fail with an error at plan time.
Analysis of Incorrect Option:
False: Incorrect, because Terraform does not assume defaults when none are provided.
Key Concept:
Terraform modules enforce required vs. optional variables depending on whether a default is set.
Terraform Exam Objective -- Interact with Terraform Modules.
Which of the following module source paths does not specify a remote module?
The module source path that does not specify a remote module issource = 'module/consul'. This specifies a local module, which is a module that is stored in a subdirectory of the current working directory. The other options are all examples of remote modules, which are modules that are stored outside of the current working directory and can be accessed by various protocols, such as Git, HTTP, or the Terraform Registry. Remote modules are useful for sharing and reusing code across different configurations and environments.Reference= [Module Sources], [Local Paths], [Terraform Registry], [Generic Git Repository], [GitHub]
Full Exam Access, Actual Exam Questions, Validated Answers, Anytime Anywhere, No Download Limits, No Practice Limits
Get All 248 Questions & Answers