1. HashiCorp Terraform Documentation
taint Command: "The terraform taint command manually marks a Terraform-managed resource as tainted
forcing it to be destroyed and recreated on the next apply." This documentation confirms that taint is the specific command for forcing replacement.
Source: HashiCorp
Terraform CLI Documentation
Command: taint. (Note: The page mentions the command is deprecated in favor of terraform apply -replace
but its function is as described and it remains a valid concept for the exam).
2. HashiCorp Terraform Documentation
state rm Command: "This command removes the resource from the state
but does not destroy the actual infrastructure object... This is a destructive operation." This clarifies that state rm is for state file manipulation
not for replacing infrastructure.
Source: HashiCorp
Terraform CLI Documentation
Command: state rm.
3. HashiCorp Terraform Documentation
Resource Targeting: "Use of -target is not recommended for routine operations... it can cause undetected configuration drift... The -target option is provided for exceptional circumstances". This explains that targeting is not for standard operations like resource replacement.
Source: HashiCorp
Terraform CLI Documentation
Command: plan
Resource Targeting (-target option).