0
0
Terraformcloud~10 mins

Plan output reading in Terraform - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Plan output reading
Run terraform plan
Terraform analyzes config
Detect changes: add, modify, delete
Generate plan output
User reads plan output
Decide to apply or not
Terraform plan reads your config, compares with current state, and shows what will change before applying.
Execution Sample
Terraform
terraform plan

# Sample output snippet:
# + aws_instance.example
# - aws_s3_bucket.old_bucket
# ~ aws_security_group.sg
Shows what resources will be added (+), removed (-), or changed (~) before applying.
Process Table
StepActionResourceChange TypeDetails
1Detect new resourceaws_instance.exampleAdd (+)Will create new EC2 instance
2Detect resource to removeaws_s3_bucket.old_bucketDelete (-)Will delete old S3 bucket
3Detect resource to updateaws_security_group.sgModify (~)Will update security group rules
4Show plan summaryPlan: 1 to add, 1 to change, 1 to destroy
5Wait for user decisionUser decides to apply or not
💡 Plan output complete, user can review changes before apply
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Resources to Add01111
Resources to Change00011
Resources to Delete00111
Key Moments - 3 Insights
Why do some resources have a '+' sign and others '-' or '~' in the plan output?
The '+' means a resource will be created, '-' means it will be deleted, and '~' means it will be modified. See execution_table rows 1-3 for examples.
Does terraform apply changes automatically after plan?
No, terraform plan only shows what will happen. The user must run 'terraform apply' to make changes. See execution_table row 5.
What if the plan shows no changes?
If no resources are added, changed, or deleted, terraform will show 'No changes. Infrastructure is up-to-date.' This means your config matches the current state.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what change type is assigned to 'aws_security_group.sg' at step 3?
AAdd (+)
BDelete (-)
CModify (~)
DNo change
💡 Hint
Check the 'Change Type' column in execution_table row 3.
At which step does terraform detect a resource to delete?
AStep 2
BStep 3
CStep 1
DStep 4
💡 Hint
Look for 'Delete (-)' in the 'Change Type' column in execution_table.
If no resources need to be added, changed, or deleted, how would the variable 'Resources to Add' look after step 3?
A1
B0
CDepends on user input
DUndefined
💡 Hint
Refer to variable_tracker row 'Resources to Add' values after step 3.
Concept Snapshot
terraform plan shows what changes will happen without applying them
+ means add, - means delete, ~ means modify
Review plan output carefully before running terraform apply
Plan output helps avoid surprises in your cloud infrastructure
Always read plan output to confirm changes
Full Transcript
Terraform plan reads your configuration and compares it to the current cloud state. It detects which resources will be added, changed, or deleted. The plan output uses symbols: plus (+) for new resources, minus (-) for deletions, and tilde (~) for modifications. This output helps you understand what terraform will do before you apply changes. You must run 'terraform apply' to make the changes happen. If no changes are needed, terraform will say the infrastructure is up-to-date. Reading the plan output carefully helps avoid mistakes and surprises in your cloud setup.