Skip to content

Commit 45705fc

Browse files
authoredMar 6, 2025
Branch 250306 disable default output env (#803)
* `disable_default_output` field can be sourced from `ARM_DISABLE_DEFAULT_OUTPUT` env * fix typo * make docs
1 parent 18189e1 commit 45705fc

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed
 

‎CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ FEATURES:
44

55
ENHANCEMENTS:
66
- `azapi` provider: The `oidc_azure_service_connection_id` field can be sourced from the `ARM_ADO_PIPELINE_SERVICE_CONNECTION_ID` or `ARM_OIDC_AZURE_SERVICE_CONNECTION_ID` Environment Variables.
7-
- `azapi` provider: The `enable_preflight` field can be sourced from the `ARM_ENABLE_PRE_FLIGHT` Environment Variable.
7+
- `azapi` provider: The `enable_preflight` field can be sourced from the `ARM_ENABLE_PREFLIGHT` Environment Variable.
8+
- `azapi` provider: The `disable_default_output` field can be sourced from the `ARM_DISABLE_DEFAULT_OUTPUT` Environment Variable.
89
- `azapi` provider: Support `maximum_busy_retry_attempts` field, which is used to specify the maximum number of busy retry attempts if the Azure API returns an HTTP 408, 429, 500, 502, 503, or 504 response.
910
- `azapi_resource_action` resource, data source: Support `sensitive_response_export_values` field, which is used to specify the sensitive fields to export.
1011
- `azaapi_resource_action` resource, data source: Support `sensitive_output` field, which is a sensitive computed field that contains the fields exported by `sensitive_response_export_values`.

‎docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ provider "azapi" {
6767
- `default_name` (String) The default name to create the azure resource. The `name` in each resource block can override the `default_name`. Changing this forces new resources to be created.
6868
- `default_tags` (Map of String) A mapping of tags which should be assigned to the azure resource as default tags. The`tags` in each resource block can override the `default_tags`.
6969
- `disable_correlation_request_id` (Boolean) This will disable the x-ms-correlation-request-id header.
70-
- `disable_default_output` (Boolean) Disable default output. The default is false. When set to false, the provider will output the read-only properties if `response_export_values` is not specified in the resource block. When set to true, the provider will disable this output.
70+
- `disable_default_output` (Boolean) Disable default output. The default is false. When set to false, the provider will output the read-only properties if `response_export_values` is not specified in the resource block. When set to true, the provider will disable this output. This can also be sourced from the `ARM_DISABLE_DEFAULT_OUTPUT` Environment Variable.
7171
- `disable_terraform_partner_id` (Boolean) Disable sending the Terraform Partner ID if a custom `partner_id` isn't specified, which allows Microsoft to better understand the usage of Terraform. The Partner ID does not give HashiCorp any direct access to usage information. This can also be sourced from the `ARM_DISABLE_TERRAFORM_PARTNER_ID` environment variable. Defaults to `false`.
7272
- `enable_preflight` (Boolean) Enable Preflight Validation. The default is false. When set to true, the provider will use Preflight to do static validation before really deploying a new resource. When set to false, the provider will disable this validation. This can also be sourced from the `ARM_ENABLE_PREFLIGHT` Environment Variable.
7373
- `endpoint` (Attributes List) The Azure API Endpoint Configuration. (see [below for nested schema](#nestedatt--endpoint))

‎internal/provider/provider.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func (p Provider) Schema(ctx context.Context, request provider.SchemaRequest, re
365365

366366
"disable_default_output": schema.BoolAttribute{
367367
Optional: true,
368-
Description: "Disable default output. The default is false. When set to false, the provider will output the read-only properties if `response_export_values` is not specified in the resource block. When set to true, the provider will disable this output.",
368+
Description: "Disable default output. The default is false. When set to false, the provider will output the read-only properties if `response_export_values` is not specified in the resource block. When set to true, the provider will disable this output. This can also be sourced from the `ARM_DISABLE_DEFAULT_OUTPUT` Environment Variable.",
369369
},
370370

371371
"maximum_busy_retry_attempts": schema.Int32Attribute{
@@ -592,7 +592,11 @@ func (p Provider) Configure(ctx context.Context, request provider.ConfigureReque
592592
}
593593
}
594594
if model.DisableDefaultOutput.IsNull() {
595-
model.DisableDefaultOutput = types.BoolValue(false)
595+
if v := os.Getenv("ARM_DISABLE_DEFAULT_OUTPUT"); v != "" {
596+
model.DisableDefaultOutput = types.BoolValue(v == "true")
597+
} else {
598+
model.DisableDefaultOutput = types.BoolValue(false)
599+
}
596600
}
597601

598602
var cloudConfig cloud.Configuration

0 commit comments

Comments
 (0)