Terraform Associate 004 ยท Core Terraform workflow
Generating and reading a plan
Refresh, diff against state, plan symbols (+ - ~ -/+), the summary line, -out saved plans, speculative plans (3d).
Key points
- terraform plan: compares configuration with refreshed state, proposes actions without performing them.
- Symbols: + create, - destroy, ~ update in place, -/+ destroy and recreate (replace).
- Summary line: resources to add, change, destroy.
- out=FILE: saves the plan for terraform apply FILE; may hold sensitive values in cleartext.
- Speculative plans: preview changes, e.g. on pull requests.
Source: https://developer.hashicorp.com/terraform/cli/commands/plan
Practice questions
Which plan symbol means a resource will be updated in place?
- +
- ~
- -/+
- -
Show answer
Answer: B. ~
~ marks an in-place update. + is create, - is destroy, and -/+ is destroy then recreate.
Which statements about a saved plan file (-out) are correct?
- It can later be passed to terraform apply
- It is safe to publish because secrets are always encrypted in it
- It may contain sensitive values in cleartext
- You can hand-edit it to change the proposed actions
- Applying it re-reads configuration and builds a new plan
Show answer
Answer: A. It can later be passed to terraform apply, C. It may contain sensitive values in cleartext
A saved plan is applied with terraform apply FILE, and it can hold sensitive values in cleartext so it must be protected. It is not editable and apply does not re-plan from it.
terraform plan creates and changes real resources so that it can measure the difference accurately.
Show answer
Answer: False
False. plan only proposes changes; resources change only on apply.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
