【问题标题】:Is there a way where terraform ignores ResourceNotFoundException and destroys the other resources有没有办法让 terraform 忽略 ResourceNotFoundException 并破坏其他资源
【发布时间】:2020-03-28 02:05:36
【问题描述】:

我正在尝试使用 terraform destroy 作业但得到 ResourceNotFoundException。这是因为资源已在上一个作业中删除。有没有一种方法可以让 terraform 忽略资源被删除并破坏其他基础设施。

示例:- Dynamo 表在上一个作业中被删除,在下一个作业中我想删除附加到它的策略和角色。

Error retrieving DynamoDB table: ResourceNotFoundException: Requested resource not found: Table

【问题讨论】:

    标签: terraform


    【解决方案1】:

    听起来如果资源消失了,但 Terraform 认为它仍然存在可以删除,最好的办法就是更新状态文件以匹配。

    terraform state rm <your_dynamo_table_resource>
    

    https://www.terraform.io/docs/commands/state/rm.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多