Skip to content

Commit 862b089

Browse files
authored
Added GCP support for databricks_mws_private_access_settings resource (#2088)
1 parent 13a47d0 commit 862b089

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

docs/resources/mws_private_access_settings.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ subcategory: "Deployment"
77

88
-> **Note** This resource has an evolving API, which will change in the upcoming versions of the provider in order to simplify user experience.
99

10-
Allows you to create a [Private Access Setting](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html#step-5-create-a-private-access-settings-configuration-using-the-databricks-account-api) that can be used as part of a [databricks_mws_workspaces](mws_workspaces.md) resource to create a [Databricks Workspace that leverages AWS PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html).
10+
Allows you to create a [Private Access Setting]that can be used as part of a [databricks_mws_workspaces](mws_workspaces.md) resource to create a [Databricks Workspace that leverages AWS PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) or [GCP Private Service Connect](https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/private-service-connect.html)
1111

12-
It is strongly recommended that customers read the [Enable Private Link](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) documentation before trying to leverage this resource.
12+
It is strongly recommended that customers read the [Enable AWS Private Link](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html) [Enable GCP Private Service Connect](https://docs.gcp.databricks.com/administration-guide/cloud-configurations/gcp/private-service-connect.html) documentation before trying to leverage this resource.
1313

1414
## Example Usage
1515

@@ -40,15 +40,37 @@ resource "databricks_mws_workspaces" "this" {
4040
depends_on = [databricks_mws_networks.this]
4141
}
4242
```
43+
or
44+
```hcl
45+
resource "databricks_mws_workspaces" "this" {
46+
provider = databricks.mws
47+
account_id = var.databricks_account_id
48+
workspace_name = "gcp-workspace"
49+
location = var.subnet_region
50+
cloud_resource_container {
51+
gcp {
52+
project_id = var.google_project
53+
}
54+
}
55+
gke_config {
56+
connectivity_type = "PRIVATE_NODE_PUBLIC_MASTER"
57+
master_ip_range = "10.3.0.0/28"
58+
}
59+
network_id = databricks_mws_networks.this.network_id
60+
private_access_settings_id = databricks_mws_private_access_settings.pas.private_access_settings_id
61+
pricing_tier = "PREMIUM"
62+
depends_on = [databricks_mws_networks.this]
63+
}
64+
```
4365

4466
## Argument Reference
4567

4668
The following arguments are available:
4769

48-
* `account_id` - Account Id that could be found in the bottom left corner of [Accounts Console](https://accounts.cloud.databricks.com/)
70+
* `account_id` - Account Id that could be found in the Accounts Console for [AWS](https://accounts.cloud.databricks.com/) or [GCP](https://accounts.gcp.databricks.com/)
4971
* `private_access_settings_name` - Name of Private Access Settings in Databricks Account
50-
* `public_access_enabled` (Boolean, Optional, `false` by default) - If `true`, the [databricks_mws_workspaces](mws_workspaces.md) can be accessed over the [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md) as well as over the public network. In such a case, you could also configure an [databricks_ip_access_list](ip_access_list.md) for the workspace, to restrict the source networks that could be used to access it over the public network. If `false` (default), the workspace can be accessed only over VPC endpoints, and not over the public network.
51-
* `region` - Region of AWS VPC
72+
* `public_access_enabled` (Boolean, Optional, `false` by default on AWS, `true` by default on GCP) - If `true`, the [databricks_mws_workspaces](mws_workspaces.md) can be accessed over the [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md) as well as over the public network. In such a case, you could also configure an [databricks_ip_access_list](ip_access_list.md) for the workspace, to restrict the source networks that could be used to access it over the public network. If `false`, the workspace can be accessed only over VPC endpoints, and not over the public network.
73+
* `region` - Region of AWS VPC or the Google Cloud VPC network
5274
* `private_access_level` - (Optional) The private access level controls which VPC endpoints can connect to the UI or API of any workspace that attaches this private access settings object. `ACCOUNT` level access _(default)_ lets only [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md) that are registered in your Databricks account connect to your [databricks_mws_workspaces](mws_workspaces.md). `ENDPOINT` level access lets only specified [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md) connect to your workspace. Please see the `allowed_vpc_endpoint_ids` documentation for more details.
5375
* `allowed_vpc_endpoint_ids` - (Optional) An array of [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md#vpc_endpoint_id) `vpc_endpoint_id` (not `id`). Only used when `private_access_level` is set to `ENDPOINT`. This is an allow list of [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md) that in your account that can connect to your [databricks_mws_workspaces](mws_workspaces.md) over AWS PrivateLink. If hybrid access to your workspace is enabled by setting `public_access_enabled` to true, then this control only works for PrivateLink connections. To control how your workspace is accessed via public internet, see the article for [databricks_ip_access_list](ip_access_list.md).
5476

@@ -57,7 +79,7 @@ The following arguments are available:
5779
In addition to all arguments above, the following attributes are exported:
5880

5981
* `private_access_settings_id` - Canonical unique identifier of Private Access Settings in Databricks Account
60-
* `status` - Status of Private Access Settings
82+
* `status` - (AWS only) Status of Private Access Settings
6183

6284
## Import
6385

internal/acceptance/mws_private_access_settings_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,16 @@ func TestMwsAccPrivateAccessSettings(t *testing.T) {
1616
}`,
1717
})
1818
}
19+
20+
func TestMwsGcpAccPrivateAccessSettings(t *testing.T) {
21+
accountLevel(t, step{
22+
Template: `
23+
resource "databricks_mws_private_access_settings" "this" {
24+
account_id = "{env.DATABRICKS_ACCOUNT_ID}"
25+
private_access_settings_name = "tf-{var.RANDOM}"
26+
region = "{env.GOOGLE_REGION}"
27+
public_access_enabled = true
28+
private_access_level = "ACCOUNT"
29+
}`,
30+
})
31+
}

0 commit comments

Comments
 (0)