Search⌘ K
AI Features

Initialize a Terraform Working Directory

Understand how to use the terraform init command to prepare your working directory by configuring state back-ends, downloading modules, and retrieving provider plugins. This lesson helps you grasp the initialization process critical for managing Terraform infrastructure effectively.

The command terraform init is used to initialize the directory containing a Terraform configuration. Once we’ve written a configuration or cloned one from source control, this is the first command we run.

Operations of the terraform init command

The terraform init command performs operations to prepare the directory holding the configuration for use. In general, they’re as follows:

  • Prepare the state storage: Whether we’re ...