plan symbols
The marks at the start of each plan line that say what will happen: + create, - destroy, ~ update in place, -/+ or +/- replace, <= read.
In more detail
The two replacement symbols differ in order: -/+ destroys the old object before creating the new one, which leaves a gap, while +/- creates the new one first. A replacement on anything holding data deserves a second read. The words forces replacement mark the attribute that caused it.
Example
# local_file.greeting must be replaced
-/+ resource "local_file" "greeting" {
~ content = "Hello" -> "Hello, again" # forces replacementRelated terms
- terraform plan — The command that compares configuration, state and reality and prints the actions needed to make them match, without changing anything.
- resource replacement — When Terraform must destroy a resource and create a new one because a changed setting cannot be updated in place.
- data source — A data block that asks a provider to look up an existing object and return its details, without Terraform creating or owning it.
Taught in
- Predicting Changes, Then Applying Them — Infrastructure as Code with Terraform
- Tearing It Down With Destroy — Infrastructure as Code with Terraform
- Scaling Resources With Count — Infrastructure as Code with Terraform
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- Dependencies, depends_on And Lifecycle Rules — HashiCorp Terraform Associate (004) Exam Prep