dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
82 stars 19 forks source link

Feature - Add support to allow warehouse connections to use PrivateLink #146

Closed b-per closed 1 year ago

b-per commented 1 year ago

Since recently, it is possible to connect dbt Cloud to the Warehouse via PrivateLink for most warehouses (all except BigQuery).

Creating those via the API require:

  1. getting the ID of the PrivateLink endpoint to use (I have some code ready for a datasource for this)
  2. modifying the current create/read/update of the resources for connections, for all the warehouse supporting PrivateLink

Here is an example of payload to create a Snowflake connection using PrivateLink:

{
  "id": null,
  "type": "snowflake",
  "account_id": "<your_account_id>",
  "project_id": "<your_project_id>",
  "name": "<your_connection_name>",
  "state": 1,
  "private_link_endpoint_id": "<your_privatelink_endpoint_id>", <-- this is the new part for point 2.
  "details": {
    "account": "<your_account>.privatelink.snowflakecomputing.com", <-- this is the account with 
    "role": null,
    "database": "db",
    "warehouse": "wh",
    "client_session_keep_alive": false,
    "allow_sso": false,
    "oauth_client_id": null,
    "oauth_client_secret": null
  }
}

I believe that for all adapters, the only change is setting a value for private_link_endpoint_id and potentially updating other existing fields (like details.account here).