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
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Export parameter for resources queried by ARG (Azure Resource Graph). Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | ExportParameter Arguments |
Export parameter for individual resources. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | ExportParameter Arguments |
Export parameter for a resource group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | ExportParameter Arguments |
Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications to make it valid.
Property | Value |
---|---|
Parameter group: | ExportParameter Arguments |
Default value: | True |
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Mask sensitive attributes in the Terraform configuration.
Property | Value |
---|---|
Parameter group: | ExportParameter Arguments |
Default value: | True |
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
The target Azure Terraform Provider.
Property | Value |
---|---|
Parameter group: | ExportParameter Arguments |
Default value: | azurerm |
Accepted values: | azapi, azurerm |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
Property | Value |
---|---|
Default value: | False |