1.

What do you mean by terraform init in the context of Terraform?

Answer»

The terraform init command creates a working directory in which Terraform CONFIGURATION files can be FOUND. After creating a new Terraform configuration or cloning an OLD one from version control, run this command first. It is safe to use this command more than once. Despite the fact that successive runs may result in errors, this command will never overwrite your current SETTINGS or state.

Syntax:

terraform init [options]

The following options can be used in conjunction with the init command :

  • -input=true: This option is set to true if the user input is mandatory. If no user input is provided, an error will be thrown.
  • -lock=false: This option is used to disable the locking of state files during state-related actions.
  • -lock-timeout=<duration>: This option is used to override the time it takes Terraform to get a state lock. If the lock is already held by another process, the default is 0s (zero seconds), which results in an immediate failure.
  • -no-color: This option disables the color codes in the command output.
  • -upgrade: This option can be CHOSEN to upgrade modules and plugins throughout the installation process.


Discussion

No Comment Found