Terraform v1.3.1执行destroy -force报错:flag未定义求助
Terraform destroy命令
-force参数报错解决办法 在使用Terraform v1.3.1执行Kubernetes资源销毁时,运行命令:
terraform destroy -force
出现如下错误:
Error: Failed to parse command-line flags
flag provided but not defined: -force
For more help on using this command, run:
terraform destroy -help
本地环境版本信息:
terraform -version Terraform v1.3.1 on linux_amd64 + provider registry.terraform.io/hashicorp/helm v2.7.0
解决办法
Terraform从v0.15.0版本起,destroy命令的-force参数已被移除,取而代之的是-auto-approve参数——该参数会跳过交互式确认步骤,直接执行销毁操作,功能与原-force完全一致。
正确的销毁命令应为:
terraform destroy -auto-approve
内容的提问来源于stack exchange,提问作者Naveen
相关产品推荐
相关产品推荐

