TA-002-P · Question #37
Which task does terraform init not perform?
The correct answer is D. Validates all required variables are present. The terraform init command prepares the working directory by downloading plugins, configuring the backend, and sourcing modules, but it does not validate the presence of required input variables.
Question
Which task does terraform init not perform?
Options
- ASources all providers present in the configuration and ensures they are downloaded and
- BConnects to the backend
- CSources any modules and copies the configuration locally
- DValidates all required variables are present
How the community answered
(14 responses)- A7% (1)
- B7% (1)
- D86% (12)
Why each option
The `terraform init` command prepares the working directory by downloading plugins, configuring the backend, and sourcing modules, but it does not validate the presence of required input variables.
`terraform init` is responsible for discovering and downloading the necessary provider plugins specified in the configuration.
`terraform init` connects to and configures the defined backend, which is essential for state management and collaboration.
`terraform init` sources any remote modules referenced in the configuration and copies them to a local `.terraform` directory.
`terraform init` focuses on setting up the environment, including downloading provider plugins, initializing the backend, and retrieving modules. It does not perform validation of the input variables; that task is typically handled by `terraform validate` or during `terraform plan` and `terraform apply` operations when values for required variables are needed.
Concept tested: terraform init command functionality
Source: https://developer.hashicorp.com/terraform/cli/commands/init
Topics
Community Discussion
No community discussion yet for this question.