首页 文章

Terraform destroy不会执行 . 给“毁灭取消”

提问于
浏览
0

我已经能够使用 terraform apply 部署AWS Auto Scaling组,负载均衡器,安全组和EC2实例 .

现在,我想使用命令 terraform destroy 销毁基础结构,但它给出 Destroy cancelled .

我不希望从AWS管理控制台手动销毁资源,而只是通过terraform命令 .

2 回答

  • 0

    消息“Destroy cancelled” . 如果在确认提示符下未键入字符串“yes”,则返回:

    Terraform will delete all your managed infrastructure.
    There is no undo. Only 'yes' will be accepted to confirm.
    
    Do you really want to destroy?
    

    Terraform需要输入 yes 作为安全措施 . 如果您以非交互方式运行Terraform,则可能无法输入此响应,因此 -force 选项提供了一种通过命令提示符进行确认的方法 .

  • 0

    我试图使用命令 terraform destroy -force 强制销毁已部署的基础架构,它运行得很好

相关问题