Step 1: Initialize
In the directory where you created main.tf, run:
bash
tofu init
What happens?
- Provider Download: It looks at your code, sees you need the
localprovider, and downloads the binary from the registry. - Backend Setup: It prepares the place where it will store information about your infrastructure.
- Lock File: It creates
.terraform.lock.hclto ensure everyone on your team uses the same provider version.
Always run init when you add new providers or clones a project.