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

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

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

Explanation:
Module sources in Terraform must be in a form Terraform can fetch: a local filesystem path, a Terraform Registry address, or a Git repository with an optional ref to pin a version. A local path is simply a directory path like ./module and cannot include any version information. A Terraform Registry module uses a namespace/name/provider form like hashicorp/consul/aws. A Git-based source can specify a repository and may include a ref query parameter to lock to a specific tag or commit, for example github.com/hashicorp/example?ref=v1.0.0. The problematic form tries to append version information directly to a local path without proper syntax, which Terraform does not recognize as a valid source. Therefore this form is not valid. The other options follow valid patterns: a local path, a registry address, and a Git source with a ref.

Module sources in Terraform must be in a form Terraform can fetch: a local filesystem path, a Terraform Registry address, or a Git repository with an optional ref to pin a version. A local path is simply a directory path like ./module and cannot include any version information. A Terraform Registry module uses a namespace/name/provider form like hashicorp/consul/aws. A Git-based source can specify a repository and may include a ref query parameter to lock to a specific tag or commit, for example github.com/hashicorp/example?ref=v1.0.0. The problematic form tries to append version information directly to a local path without proper syntax, which Terraform does not recognize as a valid source. Therefore this form is not valid. The other options follow valid patterns: a local path, a registry address, and a Git source with a ref.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy