Skip to content

Commit d05db39

Browse files
authored
refactor databricks_mws_credentials to Go SDK (#2962)
* refactor `databricks_mws_credentials` to Go SDK * bottom left -> top right * feedback * clean up tests * nit
1 parent f3c8cf7 commit d05db39

17 files changed

+172
-135
lines changed

docs/data-sources/aws_assume_role_policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ End-to-end example of provisioning Cross-account IAM role with [databricks_mws_c
1212

1313
```hcl
1414
variable "databricks_account_id" {
15-
description = "Account Id that could be found in the bottom left corner of https://accounts.cloud.databricks.com/"
15+
description = "Account Id that could be found in the top right corner of https://accounts.cloud.databricks.com/"
1616
}
1717
1818
data "databricks_aws_crossaccount_policy" "this" {}
@@ -48,7 +48,7 @@ resource "databricks_mws_credentials" "this" {
4848

4949
## Argument Reference
5050

51-
* `external_id` (Required) Account Id that could be found in the bottom left corner of [Accounts Console](https://accounts.cloud.databricks.com/).
51+
* `external_id` (Required) Account Id that could be found in the top right corner of [Accounts Console](https://accounts.cloud.databricks.com/).
5252
* `for_log_delivery` (Optional) Either or not this assume role policy should be created for usage log delivery. Defaults to false.
5353

5454
## Attribute Reference

docs/guides/aws-e2-firewall-hub-and-spoke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can provision multiple Databricks workspaces with Terraform, and where many
1010

1111
## Provider initialization for E2 workspaces
1212

13-
This guide assumes you have the `client_id`, which is the `application_id` of the [Service Principal](resources/service_principal.md), `client_secret`, which is its secret, and `databricks_account_id`, which can be found in the bottom left corner of the [Account Console](https://accounts.cloud.databricks.com). (see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)). This guide is provided as is and assumes you will use it as the basis for your setup. If you use AWS Firewall to block most traffic but allow the URLs to which Databricks needs to connect, please update the configuration based on your region. You can get the configuration details for your region from [Firewall Appliance](https://docs.databricks.com/administration-guide/cloud-configurations/aws/customer-managed-vpc.html#firewall-appliance-infrastructure) document.
13+
This guide assumes you have the `client_id`, which is the `application_id` of the [Service Principal](resources/service_principal.md), `client_secret`, which is its secret, and `databricks_account_id`, which can be found in the top right corner of the [Account Console](https://accounts.cloud.databricks.com). (see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)). This guide is provided as is and assumes you will use it as the basis for your setup. If you use AWS Firewall to block most traffic but allow the URLs to which Databricks needs to connect, please update the configuration based on your region. You can get the configuration details for your region from [Firewall Appliance](https://docs.databricks.com/administration-guide/cloud-configurations/aws/customer-managed-vpc.html#firewall-appliance-infrastructure) document.
1414

1515
```hcl
1616
variable "client_id" {}

docs/guides/aws-e2-firewall-workspace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For more information, please visit [Data Exfiltration Protection With Databricks
1212

1313
## Provider initialization for E2 workspaces
1414

15-
This guide assumes you have the `client_id`, which is the `application_id` of the [Service Principal](resources/service_principal.md), `client_secret`, which is its secret, and `databricks_account_id`, which can be found in the bottom left corner of the [Account Console](https://accounts.cloud.databricks.com). (see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)). This guide is provided as is and assumes you will use it as the basis for your setup. If you are using AWS Firewall to block most traffic but allow the URLs that Databricks needs to connect to, please update the configuration based on your region. You can get the configuration details for your region from [Firewall Appliance](https://docs.databricks.com/administration-guide/cloud-configurations/aws/customer-managed-vpc.html#firewall-appliance-infrastructure) document.
15+
This guide assumes you have the `client_id`, which is the `application_id` of the [Service Principal](resources/service_principal.md), `client_secret`, which is its secret, and `databricks_account_id`, which can be found in the top right corner of the [Account Console](https://accounts.cloud.databricks.com). (see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)). This guide is provided as is and assumes you will use it as the basis for your setup. If you are using AWS Firewall to block most traffic but allow the URLs that Databricks needs to connect to, please update the configuration based on your region. You can get the configuration details for your region from [Firewall Appliance](https://docs.databricks.com/administration-guide/cloud-configurations/aws/customer-managed-vpc.html#firewall-appliance-infrastructure) document.
1616

1717
```hcl
1818
variable "client_id" {}

docs/guides/aws-private-link-workspace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This guide uses the following variables in configurations:
1212

1313
- `client_id`: `application_id` of the service principal, see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)
1414
- `client_secret`: the secret of the service principal.
15-
- `databricks_account_id`: The numeric ID for your Databricks account. When logged in, it appears in the bottom left corner of the page.
15+
- `databricks_account_id`: The numeric ID for your Databricks account. When logged in, it appears in the top right corner of the page.
1616
- `vpc_id` - The ID for the AWS VPC.
1717
- `region` - AWS region.
1818
- `security_group_id` - Security groups set up for the existing VPC.

docs/guides/aws-workspace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can provision multiple Databricks workspaces with Terraform.
1010

1111
## Provider initialization for E2 workspaces
1212

13-
This guide assumes you have the `client_id`, which is the `application_id` of the [Service Principal](resources/service_principal.md), `client_secret`, which is its secret, and `databricks_account_id`, which can be found in the bottom left corner of the [Account Console](https://accounts.cloud.databricks.com). (see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)). This guide is provided as is and assumes you will use it as the basis for your setup.
13+
This guide assumes you have the `client_id`, which is the `application_id` of the [Service Principal](resources/service_principal.md), `client_secret`, which is its secret, and `databricks_account_id`, which can be found in the top right corner of the [Account Console](https://accounts.cloud.databricks.com). (see [instruction](https://docs.databricks.com/dev-tools/authentication-oauth.html#step-2-create-an-oauth-secret-for-a-service-principal)). This guide is provided as is and assumes you will use it as the basis for your setup.
1414

1515
```hcl
1616
variable "client_id" {}

docs/guides/unity-catalog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This guide uses the following variables in configurations:
1818

1919
- `databricks_client_id`: The `client_id` is the `application_id` of a [Service Principal](../resources/service_principal.md) that has account-level admin permission on [https://accounts.cloud.databricks.com](https://accounts.cloud.databricks.com).
2020
- `databricks_client_secret`: The secret of the above service principal.
21-
- `databricks_account_id`: The numeric ID for your Databricks account. When you are logged in, it appears in the bottom left corner of the [Databricks Account Console](https://accounts.cloud.databricks.com/) or [Azure Databricks Account Console](https://accounts.azuredatabricks.net).
21+
- `databricks_account_id`: The numeric ID for your Databricks account. When you are logged in, it appears in the top right corner of the [Databricks Account Console](https://accounts.cloud.databricks.com/) or [Azure Databricks Account Console](https://accounts.azuredatabricks.net).
2222
- `databricks_workspace_url`: Value of `workspace_url` attribute from [databricks_mws_workspaces](../resources/mws_workspaces.md#attribute-reference) resource.
2323

2424
This guide is provided as-is and you can use this guide as the basis for your custom Terraform module.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Alternatively, you can provide this value as an environment variable `DATABRICKS
205205
* `config_file` - (optional) Location of the Databricks CLI credentials file created by `databricks configure --token` command (~/.databrickscfg by default). Check [Databricks CLI documentation](https://docs.databricks.com/dev-tools/cli/index.html#set-up-authentication) for more details. The provider uses configuration file credentials when you don't specify host/token/username/password/azure attributes. Alternatively, you can provide this value as an environment variable `DATABRICKS_CONFIG_FILE`. This field defaults to `~/.databrickscfg`.
206206
* `profile` - (optional) Connection profile specified within ~/.databrickscfg. Please check [connection profiles section](https://docs.databricks.com/dev-tools/cli/index.html#connection-profiles) for more details. This field defaults to
207207
`DEFAULT`.
208-
* `account_id` - (optional) Account Id that could be found in the bottom left corner of [Accounts Console](https://accounts.cloud.databricks.com/). Alternatively, you can provide this value as an environment variable `DATABRICKS_ACCOUNT_ID`. Only has effect when `host = "https://accounts.cloud.databricks.com/"`, and is currently used to provision account admins via [databricks_user](resources/user.md). In the future releases of the provider this property will also be used specify account for `databricks_mws_*` resources as well.
208+
* `account_id` - (optional) Account Id that could be found in the top right corner of [Accounts Console](https://accounts.cloud.databricks.com/). Alternatively, you can provide this value as an environment variable `DATABRICKS_ACCOUNT_ID`. Only has effect when `host = "https://accounts.cloud.databricks.com/"`, and is currently used to provision account admins via [databricks_user](resources/user.md). In the future releases of the provider this property will also be used specify account for `databricks_mws_*` resources as well.
209209
* `auth_type` - (optional) enforce specific auth type to be used in very rare cases, where a single Terraform state manages Databricks workspaces on more than one cloud and `more than one authorization method configured` error is a false positive. Valid values are `pat`, `basic`, `oauth-m2m`, `azure-client-secret`, `azure-msi`, `azure-cli`, `google-credentials`, and `google-id`.
210210

211211
## Special configurations for AWS

docs/resources/mws_credentials.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Please follow this [complete runnable example](../guides/aws-workspace.md) with
1313

1414
```hcl
1515
variable "databricks_account_id" {
16-
description = "Account Id that could be found in the bottom left corner of https://accounts.cloud.databricks.com/"
16+
description = "Account Id that could be found in the top right corner of https://accounts.cloud.databricks.com/"
1717
}
1818
1919
data "databricks_aws_assume_role_policy" "this" {
@@ -47,7 +47,7 @@ resource "databricks_mws_credentials" "this" {
4747

4848
The following arguments are required:
4949

50-
* `account_id` - (Required) Account Id that could be found in the bottom left corner of [Accounts Console](https://accounts.cloud.databricks.com/)
50+
* `account_id` - (Optional) Account Id that could be found in the top right corner of [Accounts Console](https://accounts.cloud.databricks.com/)
5151
* `credentials_name` - (Required) name of credentials to register
5252
* `role_arn` - (Required) ARN of cross-account role
5353

@@ -61,7 +61,11 @@ In addition to all arguments above, the following attributes are exported:
6161

6262
## Import
6363

64-
-> **Note** Importing this resource is not currently supported.
64+
This resource can be imported by the combination of its identifier and the account id:
65+
66+
```bash
67+
terraform import databricks_mws_credentials.this <account_id>/<credentials_id>
68+
```
6569

6670
## Related Resources
6771

docs/resources/mws_customer_managed_keys.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You must configure this during workspace creation
2424

2525
```hcl
2626
variable "databricks_account_id" {
27-
description = "Account Id that could be found in the bottom left corner of https://accounts.cloud.databricks.com/"
27+
description = "Account Id that could be found in the top right corner of https://accounts.cloud.databricks.com/"
2828
}
2929
3030
data "aws_caller_identity" "current" {}
@@ -80,7 +80,7 @@ resource "databricks_mws_customer_managed_keys" "managed_services" {
8080

8181
```hcl
8282
variable "databricks_account_id" {
83-
description = "Account Id that could be found in the bottom left corner of https://accounts.gcp.databricks.com/"
83+
description = "Account Id that could be found in the top right corner of https://accounts.gcp.databricks.com/"
8484
}
8585
8686
variable "cmek_resource_id" {
@@ -103,7 +103,7 @@ resource "databricks_mws_customer_managed_keys" "managed_services" {
103103

104104
```hcl
105105
variable "databricks_account_id" {
106-
description = "Account Id that could be found in the bottom left corner of https://accounts.cloud.databricks.com/"
106+
description = "Account Id that could be found in the top right corner of https://accounts.cloud.databricks.com/"
107107
}
108108
109109
variable "databricks_cross_account_role" {
@@ -203,7 +203,7 @@ resource "databricks_mws_customer_managed_keys" "storage" {
203203

204204
```hcl
205205
variable "databricks_account_id" {
206-
description = "Account Id that could be found in the bottom left corner of https://accounts.gcp.databricks.com/"
206+
description = "Account Id that could be found in the top right corner of https://accounts.gcp.databricks.com/"
207207
}
208208
209209
variable "cmek_resource_id" {
@@ -226,7 +226,7 @@ The following arguments are required:
226226

227227
* `aws_key_info` - This field is a block and is documented below. This conflicts with `gcp_key_info`
228228
* `gcp_key_info` - This field is a block and is documented below. This conflicts with `aws_key_info`
229-
* `account_id` - Account Id that could be found in the bottom left corner of [Accounts Console](https://accounts.cloud.databricks.com/)
229+
* `account_id` - Account Id that could be found in the top right corner of [Accounts Console](https://accounts.cloud.databricks.com/)
230230
* `use_cases` - *(since v0.3.4)* List of use cases for which this key will be used. *If you've used the resource before, please add `use_cases = ["MANAGED_SERVICES"]` to keep the previous behaviour.* Possible values are:
231231
* `MANAGED_SERVICES` - for encryption of the workspace objects (notebooks, secrets) that are stored in the control plane
232232
* `STORAGE` - for encryption of the DBFS Storage & Cluster EBS Volumes

docs/resources/mws_log_delivery.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ End-to-end example of usage and audit log delivery:
1515

1616
```hcl
1717
variable "databricks_account_id" {
18-
description = "Account Id that could be found in the bottom left corner of https://accounts.cloud.databricks.com/"
18+
description = "Account Id that could be found in the top right corner of https://accounts.cloud.databricks.com/"
1919
}
2020
2121
resource "aws_s3_bucket" "logdelivery" {
@@ -130,7 +130,7 @@ resource "databricks_mws_log_delivery" "audit_logs" {
130130

131131
## Argument reference
132132

133-
* `account_id` - Account Id that could be found in the bottom left corner of [Accounts Console](https://accounts.cloud.databricks.com/).
133+
* `account_id` - Account Id that could be found in the top right corner of [Accounts Console](https://accounts.cloud.databricks.com/).
134134
* `config_name` - The optional human-readable name of the log delivery configuration. Defaults to empty.
135135
* `log_type` - The type of log delivery. `BILLABLE_USAGE` and `AUDIT_LOGS` are supported.
136136
* `output_format` - The file type of log delivery. Currently `CSV` (for `BILLABLE_USAGE`) and `JSON` (for `AUDIT_LOGS`) are supported.

0 commit comments

Comments
 (0)