Grep the state list
Filter managed addresses to find what TF tracks before surgery
terraform state list | grep -i 'aws_iam'
- tool
- terraform43 commands
More terraform commands
-
cat > import.tf <<'EOF' import { to = aws_instance.web id = "<id>" } EOF terraform plan -generate-config-out=generated.tfDeclarative import; -generate-config-out scaffolds HCL for the imported object
-
cat >> moved.tf <<'EOF' moved { from = aws_instance.web to = aws_instance.app } EOFRename addresses in code with no destroy/recreate; survives in version control
-
terraform apply -replace='aws_instance.web'Force destroy+recreate of one resource; replaces deprecated terraform taint
-
terraform plan -target='module.db.aws_db_instance.main'Limit plan to one address; note: -target is an escape hatch, can mask drift
-
terraform plan -refresh-onlySync state to real infra without proposing changes; surfaces out-of-band drift