Skip to content

Commit

Permalink
Merge pull request #290 from dbt-labs/add-features-global-connections
Browse files Browse the repository at this point in the history
  • Loading branch information
b-per authored Aug 28, 2024
2 parents 9132d65 + 0929d8f commit 9685e14
Show file tree
Hide file tree
Showing 24 changed files with 3,319 additions and 231 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- name: Install dependencies
run: make setup

# we install Terraform beforehand, otherwise each test requires downloading it
- uses: hashicorp/setup-terraform@v3

- name: make ${{ matrix.target }}
run: make ${{ matrix.target }}
env:
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@

All notable changes to this project will be documented in this file.

## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.12...HEAD)
## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.13...HEAD)

# [0.3.13](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.12...v0.3.13)

### Changes

- Add support for all connection types in `dbtcloud_global_connection` (added PostgreSQL, Redshift, Apache Spark, Starburst, Synapse, Fabric and Athena) and add deprecation warnings for all the other connections resources: `dbtcloud_connection`, `dbtcloud_bigquery_connection` and `dbtcloud_fabric_connection`

### Docs

- Update "Getting Started" guide to use global connections instead of project-scoped connections

### Behind the scenes

- Accelerate CI testing by:
- avoiding too many calls to `v2/.../account`
- installing Terraform manually in the CI pipeline so that each test doesn't download a new version of the CLI
- moving some tests to run in Parallel (could move more in the future)
- Update go libraries

# [0.3.12](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.11...v0.3.12)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test: deps
go test -mod=readonly -count=1 ./...

test-acceptance: deps
TF_ACC=1 go test -v -mod=readonly -count=1 ./...
TF_ACC=1 go test -v -mod=readonly -count=1 -parallel 10 ./...

check-docs: docs
git diff --exit-code -- docs
Expand Down
47 changes: 22 additions & 25 deletions docs/guides/1_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ terraform {
required_providers {
dbtcloud = {
source = "dbt-labs/dbtcloud"
version = "0.2.20"
version = "0.3.13"
}
}
}
Expand All @@ -69,24 +69,17 @@ resource "dbtcloud_project" "my_project" {
}
// create a connection and link the project to the connection
// this is an example with Snowflake but for other warehouses please look at the resource docs
resource "dbtcloud_connection" "my_connection" {
project_id = dbtcloud_project.my_project.id
type = "snowflake"
// create a global connection
resource "dbtcloud_global_connection" "my_connection" {
name = "My Snowflake warehouse"
account = "my-snowflake-account"
database = "MY_DATABASE"
role = "MY_ROLE"
warehouse = "MY_WAREHOUSE"
}
resource "dbtcloud_project_connection" "my_project_connection" {
project_id = dbtcloud_project.my_project.id
connection_id = dbtcloud_connection.my_connection.connection_id
snowflake {
account = "my-snowflake-account"
database = "MY_DATABASE"
role = "MY_ROLE"
warehouse = "MY_WAREHOUSE"
}
}
// link a repository to the dbt Cloud project
// this example adds a github repo for which we know the installation_id but the resource docs have other examples
resource "dbtcloud_repository" "my_repository" {
Expand All @@ -103,20 +96,24 @@ resource "dbtcloud_project_repository" "my_project_repository" {
// create 2 environments, one for Dev and one for Prod
// here both are linked to the same Data Warehouse connection
// for Prod, we need to create a credential as well
resource "dbtcloud_environment" "my_dev" {
dbt_version = "1.5.0-latest"
name = "Dev"
project_id = dbtcloud_project.my_project.id
type = "development"
dbt_version = "versionless"
name = "Dev"
project_id = dbtcloud_project.my_project.id
type = "development"
connection_id = dbtcloud_global_connection.my_connection.id
}
resource "dbtcloud_environment" "my_prod" {
dbt_version = "1.5.0-latest"
name = "Prod"
project_id = dbtcloud_project.my_project.id
type = "deployment"
credential_id = dbtcloud_snowflake_credential.prod_credential.credential_id
dbt_version = "versionless"
name = "Prod"
project_id = dbtcloud_project.my_project.id
type = "deployment"
deployment_type = "production"
credential_id = dbtcloud_snowflake_credential.prod_credential.credential_id
connection_id = dbtcloud_global_connection.my_connection.id
}
// we use user/password but there are other options on the resource docs
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/bigquery_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ page_title: "dbtcloud_bigquery_connection Resource - dbtcloud"
subcategory: ""
description: |-
Resource to create BigQuery connections in dbt Cloud. Can be set to use OAuth for developers.
~> This resource is going to be deprecated in the future, please use the dbtcloud_global_connection resource instead to crate BigQuery connections.
~> This resource is deprecated and is going to be removed in the next major release, please use the dbtcloud_global_connection resource instead to create BigQuery connections.
---

# dbtcloud_bigquery_connection (Resource)


Resource to create BigQuery connections in dbt Cloud. Can be set to use OAuth for developers.

~> This resource is going to be deprecated in the future, please use the `dbtcloud_global_connection` resource instead to crate BigQuery connections.
~> This resource is deprecated and is going to be removed in the next major release, please use the `dbtcloud_global_connection` resource instead to create BigQuery connections.

## Example Usage

Expand Down
12 changes: 5 additions & 7 deletions docs/resources/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
page_title: "dbtcloud_connection Resource - dbtcloud"
subcategory: ""
description: |-
Create a Data Warehouse connection for your project in dbt Cloud. The connection will need to be linked to the dbt Cloud project via a dbtcloud_project_connection resource.
This resource can be used for Databricks, Postgres, Redshift, Snowflake and AlloyDB connections.
For BigQuery, due to the list of fields being very different, you can use the dbtcloud_bigquery_connection resource.
Resource to create a Data Warehouse connection in dbt Cloud.
~> This resource is deprecated and is going to be removed in the next major release, please use the dbtcloud_global_connection resource instead to create connections.
---

# dbtcloud_connection (Resource)


Create a Data Warehouse connection for your project in dbt Cloud. The connection will need to be linked to the dbt Cloud project via a `dbtcloud_project_connection` resource.

This resource can be used for Databricks, Postgres, Redshift, Snowflake and AlloyDB connections.
For BigQuery, due to the list of fields being very different, you can use the `dbtcloud_bigquery_connection` resource.
Resource to create a Data Warehouse connection in dbt Cloud.

~> This resource is deprecated and is going to be removed in the next major release, please use the `dbtcloud_global_connection` resource instead to create connections.

## Example Usage

Expand Down
7 changes: 5 additions & 2 deletions docs/resources/fabric_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
page_title: "dbtcloud_fabric_connection Resource - dbtcloud"
subcategory: ""
description: |-
Resource to create Microsoft Fabric connections in dbt Cloud
Resource to create a MS Fabric connection in dbt Cloud.
~> This resource is deprecated and is going to be removed in the next major release, please use the dbtcloud_global_connection resource instead to create any DW connection.
---

# dbtcloud_fabric_connection (Resource)


Resource to create Microsoft Fabric connections in dbt Cloud
Resource to create a MS Fabric connection in dbt Cloud.

~> This resource is deprecated and is going to be removed in the next major release, please use the `dbtcloud_global_connection` resource instead to create any DW connection.

## Example Usage

Expand Down
Loading

0 comments on commit 9685e14

Please sign in to comment.