nerdexam
HashiCorp

TA-002-P · Question #329

terraform apply will fail if you have not run terraform plan first to update the plan output.

The correct answer is B. False. terraform apply does not strictly require a previously generated plan file; if no plan is specified, it will automatically generate one before prompting for approval to apply changes.

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

Question

terraform apply will fail if you have not run terraform plan first to update the plan output.

Options

  • ATrue
  • BFalse

How the community answered

(19 responses)
  • A
    16% (3)
  • B
    84% (16)

Why each option

`terraform apply` does not strictly require a previously generated plan file; if no plan is specified, it will automatically generate one before prompting for approval to apply changes.

ATrue

The statement is false because `terraform apply` can generate its own plan if one isn't explicitly provided, meaning a prior `terraform plan -out=FILE` command is not strictly necessary for it to succeed.

BFalseCorrect

`terraform apply` can be executed without a pre-generated plan file; if no plan file is provided as an argument, Terraform will automatically generate a new plan and display it for review before prompting for confirmation to proceed with the apply operation.

Concept tested: Terraform apply command behavior

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

Topics

#terraform apply#terraform plan#Terraform CLI#workflow

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice