Skip to main content

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+.

atmos terraform taint --help

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 Behavior

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]
note

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 init before 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.