【问题标题】:Delete terraform output from state从状态中删除地形输出
【发布时间】:2023-01-29 07:55:03
【问题描述】:

如何删除输出(不再存在)?它没有显示在 terraform state list 中,因此我无法使用 tarraform state rm 定位 int。但我在状态文件中看到它:

# terraform state pull | grep whatever -A2 -B100
{
  "version": 4,
  "terraform_version": "1.1.6",
  "serial": XXX,
  "lineage": "XXX",
  "outputs": {
    "stubborn": {
# terraform show | grep -B2 stubborn
Outputs:

stubborn = <<-EOT
<very VERY long text>
EOT

任何想法表示赞赏!

【问题讨论】:

    标签: terraform


    【解决方案1】:

    采取以下方式采用手动方法:

    terraform state pull > state-before.json
    jq 'del(.outputs.stubborn)' state-before.json > state-after.json
    # and increase serial or use --force
    terraform state push state-after.json
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-24
      • 1970-01-01
      • 2021-01-23
      • 2011-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多