atmos terraform untaint
Use this command to remove the tainted state from a Terraform resource in an Atmos component. Note: This command is deprecated in Terraform v1.0+.
Usage​
Execute the terraform untaint command like this:
atmos terraform untaint <component> -s <stack> <resource_address> [-- <terraform_flags>]
This command removes the tainted state from a resource, preventing it from being destroyed and recreated on the next apply. Note: This command is deprecated in Terraform v1.0+ since taint is also deprecated.
Atmos provides standard setup for this command including automatic terraform init, workspace selection, and variable file generation. Additionally, Atmos blocks this operation if the component is locked (metadata.locked: true). The untaint operation itself is handled by native Terraform.
Examples​
Untaint a Resource​
# Remove tainted state from a resource
atmos terraform untaint vpc -s dev aws_instance.web
Untaint with Module Path​
# Untaint a resource in a module
atmos terraform untaint app -s dev module.vpc.aws_subnet.private[0]
Arguments​
component(required)Atmos component name.
resource_address(required)Terraform resource address to untaint. This is the full resource address including any module prefix and resource index (e.g.,
aws_instance.exampleormodule.vpc.aws_subnet.private[0]).
Flags​
--stack/-s(required)Atmos stack name where the component is defined.
--skip-init(optional)Skip running
terraform initbefore executing the command.atmos terraform untaint vpc -s dev aws_instance.web --skip-init--dry-run(optional)Show what would be executed without actually running the command.
atmos terraform untaint vpc -s dev aws_instance.web --dry-run
Native Terraform Flags​
This command supports native terraform untaint flags such as -lock=false to disable state locking, -lock-timeout to override lock timeout.
Related Commands​
atmos terraform plan- Generate execution planatmos terraform apply- Apply changesatmos terraform init- Initialize working directory