nerdexam
HashiCorp

TA-002-P · Question #110

The terraform init command is always safe to run multiple times, to bring the working directory up to date with changes in the configuration. Though subsequent runs may give errors, this command…

The correct answer is B. True. The terraform init command is designed to be safely executed multiple times without deleting existing configuration or state, serving to update the working directory with necessary components.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

The terraform init command is always safe to run multiple times, to bring the working directory up to date with changes in the configuration. Though subsequent runs may give errors, this command will never delete your existing configuration or state.

Options

  • AFalse
  • BTrue

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    95% (21)

Why each option

The `terraform init` command is designed to be safely executed multiple times without deleting existing configuration or state, serving to update the working directory with necessary components.

AFalse

The statement is true because `terraform init` is designed for safe, repeatable execution without destructive actions on user configuration or state, making this choice incorrect.

BTrueCorrect

`terraform init` is idempotent and safe to run repeatedly, as its primary purpose is to initialize and update the working directory by downloading providers, modules, and configuring the backend. It explicitly avoids deleting user-authored configuration files or the Terraform state file.

Concept tested: Terraform init command safety

Source: https://developer.hashicorp.com/terraform/cli/commands/init

Topics

#terraform init#CLI commands#safe operations#configuration updates

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice