How to prevent a terraform resource from being deployed after it shows up in the planned diff?

This is not possible:

"He creates a resource and updates the state but doesn't deploy that said resource."

The state file tracks what is deployed. How would the state be updated with that resource, if the resource wasn't deployed?

What would be the ideal solution for this?

Seperate workspace?

If you are both working on resources that belong in the same environment, then that's probably not the right solution.

Taint his resource?

Tainting a resource causes an already deployed resource to be deleted and redeployed. How would that help the situation you describe?

Remove his resource from the state file?

You should never modify the state file directly.


Are you confusing the Terraform template files (.tf files) with the Terraform state file?


I'm guessing you have some terminology wrong, and what you mean to say is the resource is defined in the Terraform template, and now you need to deploy something new without including that other resource. In that case you would need to use the -target argument to deploy only certain resources.