From 8d07eff891a17133db428c02c922980e2740b223 Mon Sep 17 00:00:00 2001 From: Patrick Gross Date: Wed, 9 Dec 2020 14:06:14 +0100 Subject: [PATCH] added changes suggested by @nfx --- CHANGELOG.md | 2 +- docs/index.md | 4 ++-- provider/provider.go | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae9c70a28..fcdae687ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 0.3.0 -* Added [support for other clouds](https://github.com/databrickslabs/terraform-provider-databricks/pull/437). +* Added optional parameter azure_environment to provider config which defaults to public ([#437](https://github.com/databrickslabs/terraform-provider-databricks/pull/437)). * Added [databricks_service_principal](https://github.com/databrickslabs/terraform-provider-databricks/pull/386) resource. **Behavior changes** diff --git a/docs/index.md b/docs/index.md index 406fcfe4a8..fb4143b592 100644 --- a/docs/index.md +++ b/docs/index.md @@ -185,7 +185,7 @@ resource "databricks_scim_user" "my-user" { * `azure_client_id` - (optional) This is the Azure Enterprise Application (Service principal) client id. This service principal requires contributor access to your Azure Databricks deployment. Alternatively, you can provide this value as an environment variable `DATABRICKS_AZURE_CLIENT_ID` or `ARM_CLIENT_ID`. * `azure_tenant_id` - (optional) This is the Azure Active Directory Tenant id in which the Enterprise Application (Service Principal) resides. Alternatively, you can provide this value as an environment variable `DATABRICKS_AZURE_TENANT_ID` or `ARM_TENANT_ID`. -* `azure_environment` - (optional) This is the Azure Environment which defaults to the `public` cloud. Other options are `german`, `china` and `usgovernment`. +* `azure_environment` - (optional) This is the Azure Environment which defaults to the `public` cloud. Other options are `german`, `china` and `usgovernment`. Alternatively, you can provide this value as an environment variable `ARM_ENVIRONMENT`. * `pat_token_duration_seconds` - The current implementation of the azure auth via sp requires the provider to create a temporary personal access token within Databricks. The current AAD implementation does not cover all the APIs for Authentication. This field determines the duration in which that temporary PAT token is alive. It is measured in seconds and will default to `3600` seconds. * `debug_truncate_bytes` - Applicable only when `TF_LOG=DEBUG` is set. Truncate JSON fields in HTTP requests and responses above this limit. Default is *96*. * `debug_headers` - Applicable only when `TF_LOG=DEBUG` is set. Debug HTTP headers of requests made by the provider. Default is *false*. @@ -211,7 +211,7 @@ The following configuration attributes can be passed via environment variables: | `azure_client_secret` | `DATABRICKS_AZURE_CLIENT_SECRET` or `ARM_CLIENT_SECRET` | | `azure_client_id` | `DATABRICKS_AZURE_CLIENT_ID` or `ARM_CLIENT_ID` | | `azure_tenant_id` | `DATABRICKS_AZURE_TENANT_ID` or `ARM_TENANT_ID` | -| `azure_environment` | `DATABRICKS_AZURE_ENVIRONMENT` or `ARM_ENVIRONMENT` | +| `azure_environment` | `ARM_ENVIRONMENT` | | `debug_truncate_bytes` | `DATABRICKS_DEBUG_TRUNCATE_BYTES` | | `debug_headers` | `DATABRICKS_DEBUG_HEADERS` | diff --git a/provider/provider.go b/provider/provider.go index 57d8e85a03..59e0439e84 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -192,8 +192,7 @@ func DatabricksProvider() *schema.Provider { "azure_environment": { Type: schema.TypeString, Optional: true, - Sensitive: true, - DefaultFunc: schema.MultiEnvDefaultFunc([]string{"DATABRICKS_AZURE_ENVIRONMENT", "ARM_ENVIRONMENT"}, "public"), + DefaultFunc: schema.EnvDefaultFunc("ARM_ENVIRONMENT", "public"), }, "skip_verify": { Type: schema.TypeBool,