TA-002-P · Question #345
Which task does teraform init not perform?
The correct answer is B. Validates all required variables are present. The terraform init command prepares a Terraform working directory by downloading providers and modules and initializing the backend, but it does not validate that all required variables are present.
Question
Which task does teraform init not perform?
Options
- ASources any modules and copies the configuration locally
- BValidates all required variables are present
- CConnects to the backend
- DSources all providers present in the configuration and ensures they are downloaded and available
How the community answered
(31 responses)- B90% (28)
- C3% (1)
- D6% (2)
Why each option
The `terraform init` command prepares a Terraform working directory by downloading providers and modules and initializing the backend, but it does not validate that all required variables are present.
`terraform init` downloads and copies modules used in the configuration, making them available for use.
`terraform init` primarily sets up the working directory, downloading necessary components and configuring the backend. Variable validation, specifically checking if all required variables have been provided values, is a task performed during planning (`terraform plan`) or applying (`terraform apply`) rather than initialization.
`terraform init` establishes the connection to the configured backend, which is essential for state management and collaboration.
`terraform init` discovers and downloads the necessary provider plugins specified in the configuration, ensuring they are available for resource management.
Concept tested: Terraform init command functionalities
Source: https://developer.hashicorp.com/terraform/cli/commands/init
Topics
Community Discussion
No community discussion yet for this question.