HashiCorpHashiCorp
TA-002-P · Question #379
TA-002-P Question #379: Real Exam Question with Answer & Explanation
The correct answer is C: Cloud infrastructure. After approving the execution plan, terraform apply changes both the real-world cloud infrastructure and updates the local or remote Terraform state file.
Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)
Question
Which of the following does terraform apply change after you approve the execution plan? Choose two correct answers.
Options
- AThe execution plan
- BTerraform code
- CCloud infrastructure
- DState file
- EThe .terraform directory
Explanation
After approving the execution plan, terraform apply changes both the real-world cloud infrastructure and updates the local or remote Terraform state file.
Common mistakes.
- A. The execution plan is generated by terraform plan and consumed by terraform apply; it is not changed by apply itself.
- B. Terraform code (e.g., .tf files) defines the desired state and is written by the user; terraform apply reads it but does not modify it.
- E. The .terraform directory contains provider plugins and modules, which are managed by terraform init and not directly altered by terraform apply.
Concept tested. Terraform apply command effects
Reference. https://developer.hashicorp.com/terraform/cli/commands/apply
Topics
#terraform apply#state file#cloud infrastructure#execution plan
Community Discussion
No community discussion yet for this question.