Rationale for Correct Answer: The terraform init command is used to initialize a working directory containing Terraform configuration files. It performs tasks such as downloading providers, initializing backends, and setting up modules. It does not create any configuration files , including main.tf . Users must create .tf files manually.
Analysis of Incorrect Options (Distractors):
A. True Incorrect because Terraform does not automatically generate configuration files during initialization. It only prepares the environment for execution.
Key Concept: Understanding the role of terraform init in initializing the working directory, not generating configuration files.
[Reference: Terraform Objective Domain: Understand Terraform Basics and CLI]
Question # 105
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
This command will check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes, and will return a non-zero exit code if any files need formatting. The other commands will either make changes, list the files that need formatting, or not check the modules.