nerdexam
HashiCorp

TA-002-P · Question #325

When using providers that require the retrieval of data, such as the HashiCorp Vault provider, in what phase does Terraform actually retrieve the data required?

The correct answer is C. terraform init. The terraform init phase is where Terraform discovers, downloads, and installs the necessary provider plugins, retrieving the binary data required for providers to function.

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

Question

When using providers that require the retrieval of data, such as the HashiCorp Vault provider, in what phase does Terraform actually retrieve the data required?

Options

  • Aterraform delete
  • Bterraform plan
  • Cterraform init
  • Dterraform apply

How the community answered

(52 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    90% (47)
  • D
    6% (3)

Why each option

The `terraform init` phase is where Terraform discovers, downloads, and installs the necessary provider plugins, retrieving the binary data required for providers to function.

Aterraform delete

`terraform destroy` is used for tearing down infrastructure and does not involve the initial retrieval or setup of provider data or plugins.

Bterraform plan

While `terraform plan` evaluates configuration and may retrieve data for `data` sources, the initial retrieval and installation of the provider plugins themselves occur during the `init` phase.

Cterraform initCorrect

During the `terraform init` phase, Terraform discovers and installs the required provider plugins into the working directory, which involves retrieving the provider binaries and preparing them for use in subsequent plan and apply operations.

Dterraform apply

`terraform apply` executes the planned changes and interacts with providers, but the initial retrieval and setup of the provider plugins are completed during `init`.

Concept tested: Terraform initialization phase

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

Topics

#Terraform CLI#Providers#terraform init#Provider initialization

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice