nerdexam
HashiCorp

TA-002-P · Question #84

A terraform apply can not _________ infrastructure.

The correct answer is D. import. A terraform apply operation is used to provision, change, or destroy infrastructure according to the configuration. However, it cannot perform the import action, which is a separate command used to bring existing infrastructure under Terraform management.

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

Question

A terraform apply can not _________ infrastructure.

Options

  • Achange
  • Bdestroy
  • Cprovision
  • Dimport

How the community answered

(20 responses)
  • B
    5% (1)
  • D
    95% (19)

Why each option

A `terraform apply` operation is used to provision, change, or destroy infrastructure according to the configuration. However, it cannot perform the `import` action, which is a separate command used to bring existing infrastructure under Terraform management.

Achange

`terraform apply` is precisely used to `change` existing infrastructure by modifying resource attributes.

Bdestroy

`terraform apply -destroy` or an `apply` after removing resources from configuration can `destroy` infrastructure.

Cprovision

`terraform apply` is the primary command used to `provision` new infrastructure based on the configuration.

DimportCorrect

A `terraform apply` command executes the changes defined in a plan to bring infrastructure into alignment with the configuration; this includes provisioning new resources, changing existing ones, or destroying resources. However, importing existing infrastructure into the Terraform state is a distinct operation performed by the `terraform import` command, not `terraform apply`.

Concept tested: Terraform apply command capabilities

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

Topics

#terraform apply#cli commands#infrastructure lifecycle#resource management

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice