Skip to content

Commit 14c6a47

Browse files
authored
add BQ example for databricks_connection (#3040)
1 parent 3a38e19 commit 14c6a47

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

docs/resources/connection.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This resource manages connections in Unity Catalog
1212

1313
## Example Usage
1414

15+
Create a connection to a MySQL database
16+
1517
```hcl
1618
resource "databricks_connection" "mysql" {
1719
name = "mysql_connection"
@@ -29,13 +31,41 @@ resource "databricks_connection" "mysql" {
2931
}
3032
```
3133

34+
Create a connection to a BigQuery database
35+
36+
```hcl
37+
resource "databricks_connection" "bigquery" {
38+
name = "bq_connection"
39+
connection_type = "BIGQUERY"
40+
comment = "this is a connection to BQ"
41+
options = {
42+
GoogleServiceAccountKeyJson = jsonencode({
43+
"type" : "service_account",
44+
"project_id" : "PROJECT_ID",
45+
"private_key_id" : "KEY_ID",
46+
"private_key" : "-----BEGIN PRIVATE KEY-----\nPRIVATE_KEY\n-----END PRIVATE KEY-----\n",
47+
"client_email" : "SERVICE_ACCOUNT_EMAIL",
48+
"client_id" : "CLIENT_ID",
49+
"auth_uri" : "https://accounts.google.com/o/oauth2/auth",
50+
"token_uri" : "https://accounts.google.com/o/oauth2/token",
51+
"auth_provider_x509_cert_url" : "https://www.googleapis.com/oauth2/v1/certs",
52+
"client_x509_cert_url" : "https://www.googleapis.com/robot/v1/metadata/x509/SERVICE_ACCOUNT_EMAIL",
53+
"universe_domain" : "googleapis.com"
54+
})
55+
}
56+
properties = {
57+
purpose = "testing"
58+
}
59+
}
60+
```
61+
3262
## Argument Reference
3363

3464
The following arguments are supported:
3565

3666
- `name` - Name of the Connection.
3767
- `connection_type` - Connection type. `BIGQUERY` `MYSQL` `POSTGRESQL` `SNOWFLAKE` `REDSHIFT` `SQLDW` `SQLSERVER` or `DATABRICKS` are supported. [Up-to-date list of connection type supported](https://docs.databricks.com/query-federation/index.html#supported-data-sources)
38-
- `options` - The key value of options required by the connection, e.g. `host`, `port`, `user` and `password`.
68+
- `options` - The key value of options required by the connection, e.g. `host`, `port`, `user`, `password` or `GoogleServiceAccountKeyJson`. Please consult the [documentation](https://docs.databricks.com/query-federation/index.html#supported-data-sources) for the required option.
3969
- `owner` - (Optional) Name of the connection owner.
4070
- `properties` - (Optional) Free-form connection properties.
4171
- `comment` - (Optional) Free-form text.
@@ -44,7 +74,7 @@ The following arguments are supported:
4474

4575
In addition to all arguments above, the following attributes are exported:
4676

47-
* `id` - ID of this connection in form of `<metastore_id>|<name>`.
77+
- `id` - ID of this connection in form of `<metastore_id>|<name>`.
4878

4979
## Import
5080

0 commit comments

Comments
 (0)