Description:

  • Initializes a working directory containing Terraform configuration files.
    • download Terraform Plugin
    • create .terraform directory
    • create dependency lock file (terraform.lock.hcl) to enforce expected versions for plugins and tf
  • First command that should be run after writing a new Terraform config file or cloning an existing one from version control.
  • It is safe to run this command multiple times.

Synopsis:

  • terraform init [options]:

List of options:

  • .
  • -get-plugins=false: Skip plugin installation.
  • -upgrade: Opt to upgrade modules and plugins as part of their respective installation steps
  • -plugin-dir=PATH: Force plugin installation to read plugins only from the specified director
  • -lockfile=MODE: Set a dependency lockfile mode
  • -backend-config=backend.hcl