$ terraform init $ terraform fmt $ terraform validate $ terraform plan -out $ terraform plan -detailed-exitcode echo $? 0 drift 0 no drift 1 error 2 success ## infra drift,可能有人变更了infra并apply成功 $ terraform apply/destroy -target # $ terraform state rm $ terraform import
|