Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Terraform Associate topic 1 question 173 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 173
Topic #: 1
[All Terraform Associate Questions]

terraform init retrieves the source code for all referenced modules.

  • A. True
  • B. False
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
DevoteamAnalytix
Highly Voted 11 months, 2 weeks ago
Selected Answer: A
https://developer.hashicorp.com/terraform/cli/commands/init#child-module-installation "During init, the configuration is searched for module blocks, and the source code for referenced modules is retrieved from the locations given in their source arguments."
upvoted 5 times
...
ARBAR
Most Recent 2 weeks, 1 day ago
Selected Answer: B
terraform init initializes a Terraform working directory by downloading any necessary plugins and modules specified in the configuration files. It doesn't retrieve the source code for all referenced modules directly. Instead, it initializes the modules based on the module configurations and retrieves their source code when Terraform needs to apply changes or perform other operations.
upvoted 1 times
...
Ajit18
1 month, 4 weeks ago
B. False Terraform init does not automatically retrieve the source code for all referenced modules. Here's a breakdown of what terraform init actually does: Initializes the Terraform working directory. Downloads and installs required providers. Sets up the necessary infrastructure for working with Terraform. To retrieve module source code, you'd use terraform get or a separate module download mechanism like Git or HTTP. The source argument within your Terraform configuration specifies the location of the module's source code, which terraform init then uses to download the code during the installation process.
upvoted 2 times
...
Ganesh
3 months ago
B. False terraform init does a lot of setup work, including initializing the backend, installing providers that are used in the configuration, and preparing the working directory for other commands. However, its role in handling modules is specific to initializing modules by downloading their source code if they are not already present locally and are referenced from remote sources. It doesn't retrieve the source code for modules that are already initialized or if the modules are defined locally (in the same repository and not requiring a download). So, while it does prepare modules for use, saying it retrieves the source code for "all" referenced modules might be misleading if interpreted to mean it re-downloads or updates modules already initialized without the -upgrade flag.
upvoted 2 times
...
piezaS
11 months, 2 weeks ago
Selected Answer: B
B. False The statement is false. The terraform init command does not automatically retrieve the source code for all referenced modules in Terraform configuration. Instead, terraform init is used to initialize a Terraform working directory by downloading and installing the required providers and setting up the necessary infrastructure to work with Terraform. The source code of the modules should be present locally in the working directory or in a remote repository specified in the Terraform configuration. To retrieve the modules, you need to use the terraform get command or set up a module download mechanism like Git or HTTP.
upvoted 2 times
...
Zeppoonstream
1 year, 3 months ago
Selected Answer: A
A. True. Terraform init retrieves the source code for all referenced modules. When Terraform init is run, it will automatically download the source code for any modules referenced in the configuration files. This ensures that the correct version of the module is available for use when Terraform applies changes to the infrastructure. The source code is then cached locally so that it can be used in future runs without having to re-download it. It's important to notice that this command also initializes the backend and sets the backend configuration if specified.
upvoted 2 times
...
InformationOverload
1 year, 4 months ago
Selected Answer: A
Yes, the terraform init command retrieves the source code for all referenced modules in a Terraform configuration. It does not download the source code for any unreferenced modules or plugins.
upvoted 1 times
...
yogishrb2020
1 year, 7 months ago
Selected Answer: A
https://www.terraform.io/cli/commands/init
upvoted 2 times
...
RVivek
1 year, 7 months ago
Selected Answer: B
If the referenced module is a local module then Terra-form init does not retrieve the module or its source
upvoted 1 times
itsVespucci
1 year, 6 months ago
it will still retrieve it but would not cache it tf docs: During init, the configuration is searched for module blocks, and the source code for referenced modules is retrieved from the locations given in their source arguments.
upvoted 1 times
...
...
omodara
1 year, 7 months ago
https://www.terraform.io/language/modules/sources Terraform uses this during the module installation step of terraform init to download the source code to a directory on local disk so that other Terraform commands can use it. It is A
upvoted 4 times
...
lordogre16
1 year, 7 months ago
Selected Answer: A
During init, the configuration is searched for module blocks, and the source code for referenced modules is retrieved from the locations given in their source arguments. https://www.terraform.io/cli/commands/init
upvoted 2 times
...
A_A_AB
1 year, 7 months ago
Selected Answer: B
That's False. Init is just for installing the providers source code, not the modules.
upvoted 1 times
RVivek
1 year, 7 months ago
https://www.terraform.io/language/modules/sources Module source codes also
upvoted 2 times
...
...
depal_dhir
1 year, 8 months ago
Selected Answer: A
Terraform installs providers, initialises source code & modules etc at this stage
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...