DELAPARRA
Index
Color
NL
Category: Terraform

init

Explained by Updated

What is init?

init: Initialises a working directory — downloads providers and modules, configures the backend. Run it first, and after changing providers. terraform init prepares a working folder. It downloads the providers and modules your configuration uses, and connects to the backend where state is stored. You run it once when you start working on a project, and again after adding a provider, changing a module version or changing the backend. terraform init -upgrade updates providers to the newest versions your constraints allow.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about init

What should you keep in mind with init?

Init writes a .terraform.lock.hcl file that records exact provider versions. Commit that file, so everyone on the team and in CI uses the same versions. The .terraform folder with downloaded plugins should not be committed. If plans behave differently on two machines, comparing provider versions in the lock file is a good first check.

What does an example of init look like?

terraform init -upgrade

At a glance

CategoryTerraform
Explained by
Updated

More Terraform terms

All terms starting with I

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.