atmos terraform taint
Use this command to mark a Terraform resource for recreation in an Atmos component's next apply operation. Note: This command is deprecated in Terraform v1.0+.
Usage​
Execute the terraform taint command like this:
atmos terraform taint <component> -s <stack> [options]
This command marks a resource as tainted in the Terraform state. Tainted resources will be destroyed and recreated on the next apply. Note: This command is deprecated in Terraform v1.0+ in favor of terraform apply -replace.
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 taint operation itself is handled by native Terraform.
Examples​
Taint a Resource​
# Mark a resource as tainted
atmos terraform taint vpc -s dev aws_instance.web
Taint with Module Path​
# Taint a resource in a module
atmos terraform taint app -s dev module.vpc.aws_subnet.private[0]
In Terraform v1.0+, use terraform apply -replace instead:
atmos terraform apply vpc -s dev -replace=aws_instance.web
Arguments​
component(required)Atmos component name.
Flags​
--stack/-s(required)Atmos stack name where the component is defined.
--skip-init(optional)Skip running
terraform initbefore executing the command.atmos terraform taint vpc -s dev --skip-init--dry-run(optional)Show what would be executed without actually running the command.
atmos terraform taint vpc -s dev --dry-run
Native Terraform Flags​
This command supports native terraform taint 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