nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #151

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

The correct answer is B. source = "./module?version=vl.6.0". 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…

Interact with Terraform modules

Question

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

Options

  • Asource - "github.com/hashicorp/examplePref-ul.0.8M
  • Bsource = "./module?version=vl.6.0"
  • Csource - "hashicorp/consul/aws"
  • Dsource - "./module"

How the community answered

(33 responses)
  • A
    18% (6)
  • B
    73% (24)
  • C
    3% (1)
  • D
    6% (2)

Explanation

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.

Topics

#module sources#module registry#local modules#source syntax

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice