Skip to content

Commit baa95cd

Browse files
authored
misc doc updates (#2516)
1 parent 4d62940 commit baa95cd

File tree

8 files changed

+64
-36
lines changed

8 files changed

+64
-36
lines changed

docs/data-sources/aws_bucket_policy.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ subcategory: "Deployment"
33
---
44
# databricks_aws_bucket_policy Data Source
55

6-
This datasource configures a simple access policy for AWS S3 buckets, so that Databricks can access data in it.
6+
This datasource configures a simple access policy for AWS S3 buckets, so that Databricks can access data in it.
77

88
## Example Usage
99

@@ -30,15 +30,19 @@ Bucket policy with full access:
3030
resource "aws_s3_bucket" "ds" {
3131
bucket = "${var.prefix}-ds"
3232
acl = "private"
33-
versioning {
34-
enabled = false
35-
}
3633
force_destroy = true
3734
tags = merge(var.tags, {
3835
Name = "${var.prefix}-ds"
3936
})
4037
}
4138
39+
resource "aws_s3_bucket_versioning" "ds_versioning" {
40+
bucket = aws_s3_bucket.ds.id
41+
versioning_configuration {
42+
status = "Disabled"
43+
}
44+
}
45+
4246
data "aws_iam_policy_document" "assume_role_for_ec2" {
4347
statement {
4448
effect = "Allow"
@@ -74,7 +78,7 @@ resource "aws_s3_bucket_policy" "ds" {
7478

7579
* `bucket` - (Required) AWS S3 Bucket name for which to generate the policy document.
7680
* `full_access_role` - (Optional) Data access role that can have full access for this bucket
77-
* `databricks_e2_account_id` - (Optional) Your Databricks E2 account ID. Used to generate restrictive IAM policies that will increase the security of your root bucket
81+
* `databricks_e2_account_id` - (Optional) Your Databricks E2 account ID. Used to generate restrictive IAM policies that will increase the security of your root bucket
7882

7983
## Attribute Reference
8084

docs/guides/aws-workspace.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ locals {
4141
```
4242

4343
Before [managing workspace](workspace-management.md), you have to create:
44-
- [VPC](#vpc)
45-
- [Root bucket](#root-bucket)
46-
- [Cross-account role](#cross-account-iam-role)
47-
- [Databricks E2 workspace](#databricks-e2-workspace)
48-
- [Host and Token outputs](#provider-configuration)
44+
45+
- [VPC](#vpc)
46+
- [Root bucket](#root-bucket)
47+
- [Cross-account role](#cross-account-iam-role)
48+
- [Databricks E2 workspace](#databricks-e2-workspace)
49+
- [Host and Token outputs](#provider-configuration)
4950

5051
> Initialize provider with `alias = "mws"` and use `provider = databricks.mws` for all `databricks_mws_*` resources. We require all `databricks_mws_*` resources to be created within its own dedicated terraform module of your environment. Usually this module creates VPC and IAM roles as well.
5152
@@ -203,9 +204,6 @@ Once [VPC](#vpc) is ready, create AWS S3 bucket for DBFS workspace storage, whic
203204
resource "aws_s3_bucket" "root_storage_bucket" {
204205
bucket = "${local.prefix}-rootbucket"
205206
acl = "private"
206-
versioning {
207-
enabled = false
208-
}
209207
force_destroy = true
210208
tags = merge(var.tags, {
211209
Name = "${local.prefix}-rootbucket"
@@ -241,6 +239,13 @@ resource "aws_s3_bucket_policy" "root_bucket_policy" {
241239
depends_on = [aws_s3_bucket_public_access_block.root_storage_bucket]
242240
}
243241
242+
resource "aws_s3_bucket_versioning" "root_bucket_versioning" {
243+
bucket = aws_s3_bucket.root_storage_bucket.id
244+
versioning_configuration {
245+
status = "Disabled"
246+
}
247+
}
248+
244249
resource "databricks_mws_storage_configurations" "this" {
245250
provider = databricks.mws
246251
account_id = var.databricks_account_id
@@ -303,14 +308,14 @@ provider "databricks" {
303308
token = module.e2.token_value
304309
}
305310
```
306-
We assume that you have a terraform module in your project that creats a workspace (using [Databricks E2 Workspace](#databricks-e2-workspace) section) and you named it as `e2` while calling it in the **main.tf** file of your terraform project. And `workspace_url` and `token_value` are the output attributes of that module. This provider configuration will allow you to use the generated token during workspace creation to authenticate to the created workspace.
307311

312+
We assume that you have a terraform module in your project that creats a workspace (using [Databricks E2 Workspace](#databricks-e2-workspace) section) and you named it as `e2` while calling it in the **main.tf** file of your terraform project. And `workspace_url` and `token_value` are the output attributes of that module. This provider configuration will allow you to use the generated token during workspace creation to authenticate to the created workspace.
308313

309314
### Credentials validation checks errors
310315

311316
Due to a bug in the Terraform AWS provider (spotted in v3.28) the Databricks AWS cross-account policy creation and attachment to the IAM role takes longer than the AWS request confirmation to Terraform. As Terraform continues creating the Workspace, validation checks for the credentials are failing, as the policy doesn't get applied quick enough. Showing the error:
312317

313-
```
318+
```sh
314319
Error: MALFORMED_REQUEST: Failed credentials validation checks: Spot Cancellation, Create Placement Group, Delete Tags, Describe Availability Zones, Describe instances, Describe Instance Status, Describe Placement Group, Describe Route Tables, Describe Security Groups, Describe Spot Instances, Describe Spot Price History, Describe Subnets, Describe Volumes, Describe Vpcs, Request Spot Instances
315320
(400 on /api/2.0/accounts/{UUID}/workspaces)
316321
```
@@ -329,16 +334,14 @@ resource "time_sleep" "wait" {
329334

330335
If you notice below error:
331336

332-
```
337+
```sh
333338
Error: MALFORMED_REQUEST: Failed credentials validation checks: Spot Cancellation, Create Placement Group, Delete Tags, Describe Availability Zones, Describe instances, Describe Instance Status, Describe Placement Group, Describe Route Tables, Describe Security Groups, Describe Spot Instances, Describe Spot Price History, Describe Subnets, Describe Volumes, Describe Vpcs, Request Spot Instances
334339
```
335340

336341
- Try creating workspace from UI:
337342

338343
![create_workspace_error](https://github.com/databricks/terraform-provider-databricks/raw/master/docs/images/create_workspace_error.png)
339344

340-
341345
- Verify if the role and policy exists (assume role should allow external id)
342346

343347
![iam_role_trust_error](https://github.com/databricks/terraform-provider-databricks/raw/master/docs/images/iam_role_trust_error.png)
344-

docs/guides/unity-catalog.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,12 @@ The first step is to create the required AWS objects:
132132

133133
- An S3 bucket, which is the default storage location for managed tables in Unity Catalog. Please use a dedicated bucket for each metastore.
134134
- An IAM policy that provides Unity Catalog permissions to access and manage data in the bucket. Note that `<KMS_KEY>` is *optional*. If encryption is enabled, provide the name of the KMS key that encrypts the S3 bucket contents. *If encryption is disabled, remove the entire KMS section of the IAM policy.*
135-
- An IAM role that is associated with the IAM policy and will be assumed by Unity Catalog.
135+
- An IAM role that is associated with the IAM policy and will be assumed by Unity Catalog.
136136

137137
```hcl
138138
resource "aws_s3_bucket" "metastore" {
139139
bucket = "${local.prefix}-metastore"
140140
acl = "private"
141-
versioning {
142-
enabled = false
143-
}
144141
force_destroy = true
145142
tags = merge(local.tags, {
146143
Name = "${local.prefix}-metastore"
@@ -156,6 +153,13 @@ resource "aws_s3_bucket_public_access_block" "metastore" {
156153
depends_on = [aws_s3_bucket.metastore]
157154
}
158155
156+
resource "aws_s3_bucket_versioning" "metastore_versioning" {
157+
bucket = aws_s3_bucket.metastore.id
158+
versioning_configuration {
159+
status = "Disabled"
160+
}
161+
}
162+
159163
data "aws_iam_policy_document" "passrole_for_uc" {
160164
statement {
161165
effect = "Allow"
@@ -391,16 +395,20 @@ First, create the required objects in AWS.
391395
resource "aws_s3_bucket" "external" {
392396
bucket = "${local.prefix}-external"
393397
acl = "private"
394-
versioning {
395-
enabled = false
396-
}
397398
// destroy all objects with bucket destroy
398399
force_destroy = true
399400
tags = merge(local.tags, {
400401
Name = "${local.prefix}-external"
401402
})
402403
}
403404
405+
resource "aws_s3_bucket_versioning" "external_versioning" {
406+
bucket = aws_s3_bucket.external.id
407+
versioning_configuration {
408+
status = "Disabled"
409+
}
410+
}
411+
404412
resource "aws_s3_bucket_public_access_block" "external" {
405413
bucket = aws_s3_bucket.external.id
406414
ignore_public_acls = true

docs/resources/mws_log_delivery.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ variable "databricks_account_id" {
2323
resource "aws_s3_bucket" "logdelivery" {
2424
bucket = "${var.prefix}-logdelivery"
2525
acl = "private"
26-
versioning {
27-
enabled = false
28-
}
2926
force_destroy = true
3027
tags = merge(var.tags, {
3128
Name = "${var.prefix}-logdelivery"
@@ -42,6 +39,13 @@ data "databricks_aws_assume_role_policy" "logdelivery" {
4239
for_log_delivery = true
4340
}
4441
42+
resource "aws_s3_bucket_versioning" "logdelivery_versioning" {
43+
bucket = aws_s3_bucket.logdelivery.id
44+
versioning_configuration {
45+
status = "Disabled"
46+
}
47+
}
48+
4549
resource "aws_iam_role" "logdelivery" {
4650
name = "${var.prefix}-logdelivery"
4751
description = "(${var.prefix}) UsageDelivery role"

docs/resources/mws_networks.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ resource "databricks_mws_networks" "this" {
104104

105105
### Creating a Databricks on GCP workspace
106106

107-
-> **Public Preview** This feature is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html) on GCP.
108-
109107
```hcl
110108
variable "databricks_account_id" {
111109
description = "Account Id that could be found in the bottom left corner of https://accounts.cloud.databricks.com/"
@@ -231,5 +229,5 @@ The following resources are used in the same context:
231229
* [Provisioning Databricks on GCP](../guides/gcp-workspace.md) guide.
232230
* [Provisioning Databricks workspaces on GCP with Private Service Connect](../guides/gcp-private-service-connect-workspace.md) guide.
233231
* [databricks_mws_vpc_endpoint](mws_vpc_endpoint.md) to register [aws_vpc_endpoint](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) resources with Databricks such that they can be used as part of a [databricks_mws_networks](mws_networks.md) configuration.
234-
* [databricks_mws_private_access_settings](mws_private_access_settings.md) 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).
232+
* [databricks_mws_private_access_settings](mws_private_access_settings.md) 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).
235233
* [databricks_mws_workspaces](mws_workspaces.md) to set up [workspaces in E2 architecture on AWS](https://docs.databricks.com/getting-started/overview.html#e2-architecture-1).

docs/resources/mws_storage_configurations.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ variable "databricks_account_id" {
2323
resource "aws_s3_bucket" "root_storage_bucket" {
2424
bucket = "${var.prefix}-rootbucket"
2525
acl = "private"
26-
versioning {
27-
enabled = false
26+
}
27+
28+
resource "aws_s3_bucket_versioning" "root_versioning" {
29+
bucket = aws_s3_bucket.root_storage_bucket.id
30+
versioning_configuration {
31+
status = "Disabled"
2832
}
2933
}
3034

docs/resources/mws_workspaces.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,17 @@ resource "databricks_mws_credentials" "this" {
137137
resource "aws_s3_bucket" "root_storage_bucket" {
138138
bucket = "${local.prefix}-rootbucket"
139139
acl = "private"
140-
versioning {
141-
enabled = false
142-
}
143140
force_destroy = true
144141
tags = var.tags
145142
}
146143
144+
resource "aws_s3_bucket_versioning" "root_versioning" {
145+
bucket = aws_s3_bucket.root_storage_bucket.id
146+
versioning_configuration {
147+
status = "Disabled"
148+
}
149+
}
150+
147151
resource "aws_s3_bucket_server_side_encryption_configuration" "root_storage_bucket" {
148152
bucket = aws_s3_bucket.root_storage_bucket.bucket
149153

docs/resources/volume.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ subcategory: "Unity Catalog"
33
---
44
# databricks_volume (Resource)
55

6+
-> **Public Preview** This feature is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html).
7+
68
Volumes are Unity Catalog objects representing a logical volume of storage in a cloud object storage location. Volumes provide capabilities for accessing, storing, governing, and organizing files. While tables provide governance over tabular datasets, volumes add governance over non-tabular datasets. You can use volumes to store and access files in any format, including structured, semi-structured, and unstructured data.
79

810
A volume resides in the third layer of Unity Catalog’s three-level namespace. Volumes are siblings to tables, views, and other objects organized under a schema in Unity Catalog.
@@ -14,6 +16,7 @@ A **managed volume** is a Unity Catalog-governed storage volume created within t
1416
An **external volume** is a Unity Catalog-governed storage volume registered against a directory within an external location.
1517

1618
A volume can be referenced using its identifier: ```<catalogName>.<schemaName>.<volumeName>```, where:
19+
1720
* ```<catalogName>```: The name of the catalog containing the Volume.
1821
* ```<schemaName>```: The name of the schema containing the Volume.
1922
* ```<volumeName>```: The name of the Volume. It identifies the volume object.

0 commit comments

Comments
 (0)