terraform untaint

  • taint は state に付く「次の apply で作り直す」という印
  • terraform untaint <address> はその印を外す。壊れていると判定されたが実は正常で、作り直したくない時に使う
  • 書き換えるのは state だけで、実リソースには触らない
  • 逆に作り直したい時は terraform apply -replace="<address>" を使う
  • v1.16 時点で untaint は現役、taint は非推奨(v0.15.2 以降は -replace を使う)
  • taint は Terraform 自身も付ける。作成の途中でエラーが起きた時
    • この自動で付いた印を外す手段が要るので、untaint は現役のまま

https://developer.hashicorp.com/terraform/cli/commands/untaint https://developer.hashicorp.com/terraform/cli/commands/taint