-target

The plan, apply and destroy option that limits the run to one resource or module and whatever it depends on.

Partial applies leave the rest of the configuration out of step with reality without telling you.

In more detail

It is meant for recovering from mistakes, not routine work. Using it regularly leaves other resources out of date and hides drift, and Terraform warns every time you use it.

Example

terraform destroy -target=local_file.greeting

Related terms

Taught in

References

Certification courses