nerdexam
HashiCorp

TA-002-P · Question #347

A terraform apply can not___________infrastructure.

The correct answer is A. import. While terraform apply can provision, change, or destroy infrastructure, it does not have the capability to import existing infrastructure into the Terraform state.

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

Question

A terraform apply can not___________infrastructure.

Options

  • Aimport
  • Bprovision
  • Cdestroy
  • Dchange

How the community answered

(42 responses)
  • A
    93% (39)
  • B
    5% (2)
  • D
    2% (1)

Why each option

While `terraform apply` can provision, change, or destroy infrastructure, it does not have the capability to import existing infrastructure into the Terraform state.

AimportCorrect

`terraform apply` executes the actions defined in a Terraform plan, which includes creating new resources, updating existing ones, or destroying resources. Importing existing infrastructure into Terraform state is a separate operation performed using the `terraform import` command, not `terraform apply`.

Bprovision

`terraform apply` provisions new infrastructure resources defined in the configuration.

Cdestroy

`terraform apply` with the -destroy flag can be used to destroy all resources managed by the configuration.

Dchange

`terraform apply` is used to change or update existing infrastructure resources to match the desired state in the configuration.

Concept tested: Terraform apply command capabilities

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

Topics

#terraform apply#terraform import#Terraform CLI#infrastructure management

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice