resource replacement

When Terraform must destroy a resource and create a new one because a changed setting cannot be updated in place.

In more detail

For a database or bucket holding restricted data, a replacement means data loss whatever the intent. replace_paths in the plan shows which attribute forced it, and a guardrail can refuse such plans.

Examples

terraform plan -replace="null_resource.example"
In Terraform: The plan marks it with -/+ or +/- and names the attribute that forces replacement. A replacement gives the object a new identity, so anything holding data, or referred to by other systems, needs extra review. You can also force one deliberately with terraform apply -replace and the resource address, which replaced the older taint command.

Related terms

Taught in

References

Certification courses