Skip to content

Commit cd5080f

Browse files
Document Terraform examples (#167)
* Optional Resource Group creation in adb-lakehouse module The commit contains the implementation for the workspace resource group. However this change requires to no more use the local.rg_location variable, since the value is known after the apply, and rhis force the replacement of all of the resources * Fix resource group name value in the azure data factory resource * Document examples Most of README files were already defined. TFDocs updated in each of them * Remove modules reference and change how to use guide
1 parent 93c7414 commit cd5080f

File tree

20 files changed

+1043
-142
lines changed

20 files changed

+1043
-142
lines changed

examples/aws-workspace-basic/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,37 @@ This template provides an example of a simple deployment of AWS Databricks E2 wo
2121
6. (Optional) Configure your [remote backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3)
2222
7. Run `terraform init` to initialize terraform and get provider ready.
2323
8. Run `terraform apply` to create the resources.
24+
25+
## Requirements
26+
27+
| Name | Version |
28+
|------------------------------------------------------------------------------|----------|
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 |
30+
| <a name="requirement_databricks"></a> [databricks](#requirement\_databricks) | >=1.13.0 |
31+
32+
## Providers
33+
34+
No providers.
35+
36+
## Modules
37+
38+
| Name | Source | Version |
39+
|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|---------|
40+
| <a name="module_aws-workspace-basic"></a> [aws-workspace-basic](#module\_aws-workspace-basic) | github.com/databricks/terraform-databricks-examples/modules/aws-workspace-basic | n/a |
41+
42+
## Resources
43+
44+
No resources.
45+
46+
## Inputs
47+
48+
| Name | Description | Type | Default | Required |
49+
|-------------------------------------------------------------------------------------------------------|-------------------------------------------|---------------|-----------------|:--------:|
50+
| <a name="input_cidr_block"></a> [cidr\_block](#input\_cidr\_block) | IP range for AWS VPC | `string` | `"10.4.0.0/16"` | no |
51+
| <a name="input_databricks_account_id"></a> [databricks\_account\_id](#input\_databricks\_account\_id) | Databricks Account ID | `string` | n/a | yes |
52+
| <a name="input_region"></a> [region](#input\_region) | AWS region to deploy to | `string` | `"eu-west-1"` | no |
53+
| <a name="input_tags"></a> [tags](#input\_tags) | Optional tags to add to created resources | `map(string)` | `{}` | no |
54+
55+
## Outputs
56+
57+
No outputs.

examples/aws-workspace-config/README.md

+11-21
Original file line numberDiff line numberDiff line change
@@ -69,49 +69,39 @@ The process will be: provision ordinary users -> assign users to groups -> assig
6969

7070
You can manage users/groups inside terraform. Examples were given in `main.tf`. Note that with Unity Catalog, you can have account level users/groups. The example here is at workspace level.
7171

72-
<!-- BEGIN_TF_DOCS -->
7372
## Requirements
7473

7574
No requirements.
7675

7776
## Providers
7877

7978
| Name | Version |
80-
| ---------------------------------------------------------------------------------- | ------- |
79+
|------------------------------------------------------------------------------------|---------|
8180
| <a name="provider_databricks"></a> [databricks](#provider\_databricks) | 1.3.1 |
8281
| <a name="provider_databricks.ws1"></a> [databricks.ws1](#provider\_databricks.ws1) | 1.3.1 |
8382

84-
## Modules
85-
86-
| Name | Source | Version |
87-
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ------- |
88-
| <a name="module_engineering_compute_policy"></a> [engineering\_compute\_policy](#module\_engineering\_compute\_policy) | ./modules/base_policy | n/a |
89-
| <a name="module_ip_access_list_workspace_1"></a> [ip\_access\_list\_workspace\_1](#module\_ip\_access\_list\_workspace\_1) | ./modules/ip_access_list | n/a |
90-
| <a name="module_ip_access_list_workspace_2"></a> [ip\_access\_list\_workspace\_2](#module\_ip\_access\_list\_workspace\_2) | ./modules/ip_access_list | n/a |
91-
9283
## Resources
9384

94-
| Name | Type |
95-
| ------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
96-
| [databricks_cluster.tiny](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster) | resource |
97-
| [databricks_group.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group) | resource |
98-
| [databricks_group_member.vip_member](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group_member) | resource |
99-
| [databricks_user.user2](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/user) | resource |
85+
| Name | Type |
86+
|------|------|
87+
| [databricks_cluster.tiny](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster) | resource |
88+
| [databricks_group.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group) | resource |
89+
| [databricks_group_member.vip_member](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group_member) | resource |
90+
| [databricks_user.user2](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/user) | resource |
10091
| [databricks_spark_version.latest_lts](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/spark_version) | data source |
101-
| [databricks_user.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/user) | data source |
92+
| [databricks_user.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/user) | data source |
10293

10394
## Inputs
10495

10596
| Name | Description | Type | Default | Required |
106-
| -------------------------------------------------------------- | ----------- | -------- | ------- | :------: |
97+
|----------------------------------------------------------------|-------------|----------|---------|:--------:|
10798
| <a name="input_pat_ws_1"></a> [pat\_ws\_1](#input\_pat\_ws\_1) | n/a | `string` | n/a | yes |
10899
| <a name="input_pat_ws_2"></a> [pat\_ws\_2](#input\_pat\_ws\_2) | n/a | `string` | n/a | yes |
109100

110101
## Outputs
111102

112103
| Name | Description |
113-
| --------------------------------------------------------------------------------------------------------------- | ----------- |
104+
|-----------------------------------------------------------------------------------------------------------------|-------------|
114105
| <a name="output_all_allow_lists_patched"></a> [all\_allow\_lists\_patched](#output\_all\_allow\_lists\_patched) | n/a |
115106
| <a name="output_all_block_lists_patched"></a> [all\_block\_lists\_patched](#output\_all\_block\_lists\_patched) | n/a |
116-
| <a name="output_sample_cluster_id"></a> [sample\_cluster\_id](#output\_sample\_cluster\_id) | n/a |
117-
<!-- END_TF_DOCS -->
107+
| <a name="output_sample_cluster_id"></a> [sample\_cluster\_id](#output\_sample\_cluster\_id) | n/a |

examples/aws-workspace-uc-simple/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,70 @@ When running tf configs for UC resources, due to sometimes requires a few minute
1414
> Step 1: Fill in values in `terraform.tfvars`; also configure env necessary variables for AWS provider authentication.
1515
1616
> Step 2: Run `terraform init` and `terraform apply` to deploy the resources. This will deploy both AWS resources that Unity Catalog requires and Databricks Account Level resources.
17+
18+
## Requirements
19+
20+
| Name | Version |
21+
|------------------------------------------------------------------------------|-------------------|
22+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 |
23+
| <a name="requirement_databricks"></a> [databricks](#requirement\_databricks) | >= 1.2.0, < 2.0.0 |
24+
| <a name="requirement_random"></a> [random](#requirement\_random) | =3.4.1 |
25+
| <a name="requirement_time"></a> [time](#requirement\_time) | =0.9.1 |
26+
27+
## Providers
28+
29+
| Name | Version |
30+
|------------------------------------------------------------------------------------------------------|-------------------|
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 5.0 |
32+
| <a name="provider_databricks.mws"></a> [databricks.mws](#provider\_databricks.mws) | >= 1.2.0, < 2.0.0 |
33+
| <a name="provider_databricks.workspace"></a> [databricks.workspace](#provider\_databricks.workspace) | >= 1.2.0, < 2.0.0 |
34+
| <a name="provider_random"></a> [random](#provider\_random) | =3.4.1 |
35+
| <a name="provider_time"></a> [time](#provider\_time) | =0.9.1 |
36+
37+
38+
## Resources
39+
40+
| Name | Type |
41+
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
42+
| [databricks_catalog.demo_catalog](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/catalog) | resource |
43+
| [databricks_cluster.unity_catalog_cluster](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster) | resource |
44+
| [databricks_grants.unity_catalog_grants](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/grants) | resource |
45+
| [databricks_group.admin_group](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group) | resource |
46+
| [databricks_group.users](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group) | resource |
47+
| [databricks_group_member.admin_group_member](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group_member) | resource |
48+
| [databricks_group_member.my_service_principal](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group_member) | resource |
49+
| [databricks_group_member.users_group_members](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group_member) | resource |
50+
| [databricks_mws_permission_assignment.add_admin_group](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_permission_assignment) | resource |
51+
| [databricks_mws_permission_assignment.add_user_group](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mws_permission_assignment) | resource |
52+
| [databricks_user.unity_users](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/user) | resource |
53+
| [random_string.naming](https://registry.terraform.io/providers/hashicorp/random/3.4.1/docs/resources/string) | resource |
54+
| [time_sleep.wait_for_permission_apis](https://registry.terraform.io/providers/hashicorp/time/0.9.1/docs/resources/sleep) | resource |
55+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
56+
| [databricks_node_type.smallest](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/node_type) | data source |
57+
| [databricks_service_principal.admin_service_principal](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/service_principal) | data source |
58+
| [databricks_spark_version.latest_version](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/spark_version) | data source |
59+
60+
## Inputs
61+
62+
| Name | Description | Type | Default | Required |
63+
|-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|---------|:--------:|
64+
| <a name="input_aws_access_services_role_name"></a> [aws\_access\_services\_role\_name](#input\_aws\_access\_services\_role\_name) | (Optional) Name for the AWS Services role by this module | `string` | `null` | no |
65+
| <a name="input_aws_profile"></a> [aws\_profile](#input\_aws\_profile) | (Required) AWS cli profile to be used for authentication with AWS | `string` | n/a | yes |
66+
| <a name="input_cidr_block"></a> [cidr\_block](#input\_cidr\_block) | (Required) CIDR block to be used to create the Databricks VPC | `string` | n/a | yes |
67+
| <a name="input_databricks_account_id"></a> [databricks\_account\_id](#input\_databricks\_account\_id) | (Required) Databricks Account ID | `string` | n/a | yes |
68+
| <a name="input_databricks_client_id"></a> [databricks\_client\_id](#input\_databricks\_client\_id) | (Required) Client ID to authenticate the Databricks provider at the account level | `string` | n/a | yes |
69+
| <a name="input_databricks_client_secret"></a> [databricks\_client\_secret](#input\_databricks\_client\_secret) | (Required) Client secret to authenticate the Databricks provider at the account level | `string` | n/a | yes |
70+
| <a name="input_databricks_metastore_admins"></a> [databricks\_metastore\_admins](#input\_databricks\_metastore\_admins) | List of Admins to be added at account-level for Unity Catalog.<br/> Enter with square brackets and double quotes<br/> e.g ["[email protected]", "[email protected]"] | `list(string)` | n/a | yes |
71+
| <a name="input_databricks_users"></a> [databricks\_users](#input\_databricks\_users) | List of Databricks users to be added at account-level for Unity Catalog.<br/> Enter with square brackets and double quotes<br/> e.g ["[email protected]", "[email protected]"] | `list(string)` | n/a | yes |
72+
| <a name="input_my_username"></a> [my\_username](#input\_my\_username) | (Required) Username in the form of an email to be added to the tags and be declared as owner of the assets | `string` | n/a | yes |
73+
| <a name="input_region"></a> [region](#input\_region) | (Required) AWS region where the assets will be deployed | `string` | n/a | yes |
74+
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) List of tags to be propagated accross all assets in this demo | `map(string)` | n/a | yes |
75+
| <a name="input_unity_admin_group"></a> [unity\_admin\_group](#input\_unity\_admin\_group) | (Required) Name of the admin group. This group will be set as the owner of the Unity Catalog metastore | `string` | n/a | yes |
76+
| <a name="input_workspace_name"></a> [workspace\_name](#input\_workspace\_name) | (Required) Databricks workspace name to be used for deployment | `string` | n/a | yes |
77+
78+
## Outputs
79+
80+
| Name | Description |
81+
|------------------------------------------------------------------------------------------------------------------|--------------------------|
82+
| <a name="output_databricks_workspace_id"></a> [databricks\_workspace\_id](#output\_databricks\_workspace\_id) | Databricks workspace ID |
83+
| <a name="output_databricks_workspace_url"></a> [databricks\_workspace\_url](#output\_databricks\_workspace\_url) | Databricks workspace URL |

0 commit comments

Comments
 (0)