az terraform
Note
This reference is part of the terraform extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az terraform command. Learn more about extensions.
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Azure Terraform experience.
Commands
Name | Description | Type | Status |
---|---|---|---|
az terraform export-terraform |
Exports the Terraform configuration of the specified resource(s). |
Extension | Preview |
az terraform export-terraform
Command group 'az terraform' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Exports the Terraform configuration of the specified resource(s).
az terraform export-terraform [--export-query]
[--export-resource]
[--export-resource-group]
[--full-properties {0, 1, f, false, n, no, t, true, y, yes}]
[--mask-sensitive {0, 1, f, false, n, no, t, true, y, yes}]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--target-provider {azapi, azurerm}]
Examples
Export a resource group targeting to `azurerm` provider
az terraform export-terraform --export-resource-group '{resource-group-name:my-rg}'
Export a list of resources targeting to `azapi` provider
az terraform export-terraform --full-properties false --target-provider azapi --export-resource '{resource-ids:[id1,id2,id3]}'
Export all virtual networks in the current subscription, together with their child resources (e.g. subnets) targeting `azapi` provider
az terraform export-terraform --full-properties false --target-provider azapi --export-query "{query:'type =~ \"microsoft.network/virtualnetworks\"',recursive:true}"
Optional Parameters
Export parameter for resources queried by ARG (Azure Resource Graph). Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Export parameter for individual resources. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Export parameter for a resource group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications to make it valid.
Mask sensitive attributes in the Terraform configuration.
Do not wait for the long-running operation to finish.
The target Azure Terraform Provider.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.