Terraform Fundamentals2 / 5
A developer adds a new provider requirement to a configuration and runs terraform plan, but receives an error stating the required provider plugin is not installed. What is the correct command to install the provider and prepare the working directory?
CorrectIncorrect
Alex
terraform init is the first command you run in any new or changed configuration. It performs several initialization tasks: it configures the backend for state storage, downloads and installs the provider plugins declared in required_providers, downloads any referenced modules, and creates or updates the .terraform.lock.hcl dependency lock file. When a provider requirement is added or changed, you must re-run init so Terraform can fetch the appropriate plugin version that satisfies your version constraints. Other commands like validate, plan, and apply assume providers are already installed. Exam tip: any error about a missing provider, module, or backend almost always means you need to run terraform init.
Sourcedeveloper.hashicorp.com
Follow-up answers are available in the app. Create a free account — no credit card required.
Question 2 of 5
Create a free account