Skip to content

Commit

Permalink
Update docs and Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
b-per committed Aug 28, 2024
1 parent db01316 commit 89ab785
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 53 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

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

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

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
47 changes: 22 additions & 25 deletions templates/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
9 changes: 7 additions & 2 deletions terraform_resources.d2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*.*.style.font-size: 22

title: |md
# Terraform resources (v0.3.11)
# Terraform resources (v0.3.13)
| {near: top-center}

direction: right
Expand Down Expand Up @@ -30,11 +30,16 @@ job: {
}
}

conns: Connections {
conns: Connections (will be removed in the future,\nuse global_connection) {
bigquery_connection
fabric_connection
connection: {tooltip: Works for Snowflake, Redshift, Postgres and Databricks}

bigquery_connection.style.fill: "#C5C6C7"
fabric_connection.style.fill: "#C5C6C7"
connection.style.fill: "#C5C6C7"
}
conns.style.fill: "#C5C6C7"

env_creds: Environment Credentials {
grid-columns: 2
Expand Down
Binary file modified terraform_resources.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 89ab785

Please sign in to comment.