{
  "id": "aztfexport",
  "name": "Azure Export for Terraform",
  "homepage": "https://github.com/Azure/aztfexport",
  "description": "A tool to bring existing Azure resources under Terraform's management.",
  "executables": [
    "aztfexport"
  ],
  "platforms": [
    "macos",
    "linux"
  ],
  "dotfiles": {
    "paths": [
      "~/.aztfexport/config.json"
    ],
    "exclude": [],
    "secret": []
  },
  "commands": {
    "format": 1,
    "label": "Export Azure resources to Terraform",
    "description": "Export a resource group (or single resources) to Terraform configuration and state. Authentication, backend, query and mapping-file modes are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "resource-group"
        ],
        "label": "Export a resource group",
        "source": [
          {
            "id": "docs",
            "kind": "manual",
            "url": "https://learn.microsoft.com/en-us/azure/developer/terraform/azure-export-for-terraform/export-terraform-concepts",
            "revision": "2026-10-27",
            "evidence": "aztfexport resource-group [option] <resource group name>\naztfexport resource-group myResourceGroup\naztfexport resource -o tempdir --hcl-only <resource_id>\nFor a non-interactive resource, add the --non-interactive flag: aztfexport rg --non-interactive myResourceGroup.\nThe --hcl-only flag specifies to export the configured resources to HCL\nIf the directory in which you're running Azure Export for Terraform isn't empty, you must add the --overwrite flag to use the --hcl-only flag.\naztfexport [command] --append <scope>\nTo specify a different environment other than public cloud, use the --env flag. For example, for US Government:\naztfexport [command] --env=\"usgovernment\" [further options] <scope>\naztfexport [command] --provider-name=azapi --provider-version=1.10.0 [further options] <scope>\nIf you aren't sure what resources exist within an environment, you can verify by specifying the --generate-mapping-file flag.\n"
          }
        ],
        "field": [
          {
            "id": "resource_group",
            "label": "Resource group name",
            "type": "string",
            "position": 0,
            "sources": [
              "docs"
            ]
          },
          {
            "id": "output_dir",
            "label": "Output directory",
            "description": "Defaults to the current directory.",
            "type": "path",
            "option": [
              "-o"
            ],
            "path": {
              "kind": "directory",
              "role": "output"
            },
            "sources": [
              "docs"
            ]
          },
          {
            "id": "hcl_only",
            "label": "HCL only (no state)",
            "description": "Generate configuration without importing resources into Terraform state.",
            "type": "boolean",
            "option": [
              "--hcl-only"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "non_interactive",
            "label": "Non-interactive",
            "type": "boolean",
            "option": [
              "--non-interactive"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "append",
            "label": "Append to existing state",
            "description": "Import into the existing state file and keep the output directory contents.",
            "type": "boolean",
            "option": [
              "--append"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "overwrite",
            "label": "Overwrite non-empty directory",
            "type": "boolean",
            "option": [
              "--overwrite"
            ],
            "effect": "overwrite",
            "sources": [
              "docs"
            ]
          },
          {
            "id": "provider_name",
            "label": "Terraform provider",
            "type": "string",
            "option": [
              "--provider-name"
            ],
            "suggestions": [
              {
                "value": "azurerm",
                "label": "AzureRM"
              },
              {
                "value": "azapi",
                "label": "AzAPI"
              }
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "provider_version",
            "label": "Provider version",
            "type": "string",
            "option": [
              "--provider-version"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "env",
            "label": "Cloud environment",
            "type": "string",
            "option": [
              "--env"
            ],
            "suggestions": [
              {
                "value": "public",
                "label": "Public"
              },
              {
                "value": "usgovernment",
                "label": "US Government"
              },
              {
                "value": "china",
                "label": "China"
              }
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "generate_mapping_file",
            "label": "Only generate mapping file",
            "type": "boolean",
            "option": [
              "--generate-mapping-file"
            ],
            "sources": [
              "docs"
            ]
          }
        ],
        "task": [
          {
            "id": "export",
            "label": "Export interactively",
            "fields": [
              "resource_group",
              "output_dir",
              "provider_name"
            ],
            "required": [
              "resource_group"
            ]
          },
          {
            "id": "hcl",
            "label": "Generate HCL only, unattended",
            "set": {
              "hcl_only": [
                true
              ],
              "non_interactive": [
                true
              ]
            },
            "fields": [
              "resource_group",
              "output_dir",
              "hcl_only",
              "non_interactive",
              "overwrite"
            ],
            "required": [
              "resource_group"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "resource_group",
              "output_dir",
              "hcl_only",
              "non_interactive"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "append",
              "overwrite",
              "provider_name",
              "provider_version",
              "env",
              "generate_mapping_file"
            ]
          }
        ]
      }
    ]
  }
}
