{
  "id": "terraform",
  "name": "Terraform",
  "homepage": "https://developer.hashicorp.com/terraform",
  "description": "An infrastructure as code tool that lets you build, change, and version infrastructure safely and efficiently.",
  "icon": "SimpleIcons:terraform",
  "executables": [
    "terraform"
  ],
  "dotfiles": {
    "paths": [
      "~/.terraformrc",
      "%APPDATA%/terraform.rc"
    ],
    "exclude": [],
    "secret": [
      "~/.terraform.d/credentials.tfrc.json",
      "%APPDATA%/terraform.d/credentials.tfrc.json"
    ],
    "secret_paths": [
      {
        "file": [
          "~/.terraformrc",
          "%APPDATA%/terraform.rc"
        ],
        "match": {
          "prefix": [
            "token"
          ]
        }
      }
    ],
    "machine_lines": [
      {
        "file": [
          "~/.terraformrc",
          "%APPDATA%/terraform.rc"
        ],
        "match": {
          "prefix": [
            "plugin_cache_dir"
          ]
        },
        "scope": "backup"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Terraform workflow",
    "description": "Initialize, validate, plan and apply Terraform configuration. Only flags listed in the Fig spec are offered, so apply -auto-approve and similar are left out.",
    "quality": "ai-draft",
    "base": "fig:terraform",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/terraform.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "chdir",
        "label": "Working directory",
        "type": "path",
        "option": [
          "-chdir"
        ],
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "chdir"
        ]
      }
    ],
    "subcommand": [
      {
        "path": [
          "init"
        ],
        "label": "Initialize working directory",
        "description": "Download providers and modules. Backend options are left out.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/terraform.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "upgrade",
            "label": "Upgrade modules and plugins",
            "type": "boolean",
            "option": [
              "-upgrade"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "no_color",
            "label": "Disable color",
            "type": "boolean",
            "option": [
              "-no-color"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "init",
            "label": "Initialize",
            "fields": [
              "upgrade"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "upgrade",
              "no_color"
            ]
          }
        ]
      },
      {
        "path": [
          "validate"
        ],
        "label": "Validate configuration",
        "description": "Check whether the configuration is valid.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/terraform.ts",
            "license": "MIT"
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": []
          }
        ]
      },
      {
        "path": [
          "plan"
        ],
        "label": "Plan changes",
        "description": "Show what Terraform would change. Nothing is applied.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/terraform.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "out",
            "label": "Save plan to file",
            "type": "path",
            "option": [
              "-out"
            ],
            "path": {
              "kind": "file",
              "role": "output",
              "must_exist": false
            },
            "effect": "overwrite",
            "sources": [
              "fig"
            ]
          },
          {
            "id": "var_file",
            "label": "Variable file",
            "type": "path",
            "option": [
              "-var-file"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "var",
            "label": "Variables (name=value)",
            "type": "string",
            "option": [
              "-var"
            ],
            "multiple": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "target",
            "label": "Target resource addresses",
            "type": "string",
            "option": [
              "-target"
            ],
            "multiple": true,
            "sources": [
              "fig"
            ]
          },
          {
            "id": "destroy",
            "label": "Plan to destroy everything",
            "type": "boolean",
            "option": [
              "-destroy"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "detailed_exitcode",
            "label": "Detailed exit code",
            "type": "boolean",
            "option": [
              "-detailed-exitcode"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "refresh",
            "label": "Refresh state first",
            "type": "enum",
            "option": [
              "-refresh"
            ],
            "choices": [
              {
                "value": "true",
                "label": "Yes"
              },
              {
                "value": "false",
                "label": "No"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "parallelism",
            "label": "Parallelism",
            "type": "integer",
            "option": [
              "-parallelism"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "no_color",
            "label": "Disable color",
            "type": "boolean",
            "option": [
              "-no-color"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "plan",
            "label": "Plan and save",
            "fields": [
              "out",
              "var_file",
              "var"
            ],
            "required": []
          },
          {
            "id": "destroy_plan",
            "label": "Plan a destroy",
            "fields": [
              "destroy",
              "out"
            ],
            "required": [
              "destroy"
            ],
            "set": {
              "destroy": [
                true
              ]
            }
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "out",
              "var_file",
              "var",
              "target",
              "destroy"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "detailed_exitcode",
              "refresh",
              "parallelism",
              "no_color"
            ]
          }
        ]
      },
      {
        "path": [
          "apply"
        ],
        "label": "Apply changes",
        "description": "Create or update infrastructure, optionally from a saved plan file. Review the plan first.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/terraform.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "plan_file",
            "label": "Saved plan file",
            "type": "path",
            "position": 0,
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "apply_plan",
            "label": "Apply saved plan",
            "fields": [
              "plan_file"
            ],
            "required": [
              "plan_file"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "plan_file"
            ]
          }
        ]
      }
    ]
  }
}
