Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all connections to dbtcloud_global_connection #290

Merged
merged 8 commits into from
Aug 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add deprecation warning for old resources
b-per committed Aug 28, 2024
commit 6875fc8cfc5fa2cc69c2582386ab837278a6b8bd
4 changes: 2 additions & 2 deletions docs/resources/bigquery_connection.md
Original file line number Diff line number Diff line change
@@ -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

12 changes: 5 additions & 7 deletions docs/resources/connection.md
Original file line number Diff line number Diff line change
@@ -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

7 changes: 5 additions & 2 deletions docs/resources/fabric_connection.md
Original file line number Diff line number Diff line change
@@ -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

3 changes: 2 additions & 1 deletion pkg/sdkv2/resources/bigquery_connection.go
Original file line number Diff line number Diff line change
@@ -27,8 +27,9 @@ func ResourceBigQueryConnection() *schema.Resource {
Description: helper.DocString(
`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.`,
),
DeprecationMessage: "Please replace this resource with a `dbtcloud_global_connection` resource. This resource type will be removed in the next major release.",
Schema: map[string]*schema.Schema{
"connection_id": {
Type: schema.TypeInt,
14 changes: 7 additions & 7 deletions pkg/sdkv2/resources/connection.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (
"strings"

"github.com/dbt-labs/terraform-provider-dbtcloud/pkg/dbt_cloud"
"github.com/dbt-labs/terraform-provider-dbtcloud/pkg/helper"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
@@ -22,20 +23,19 @@ var (
}
)

var docs string = fmt.Sprintf(`
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 %s 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 %s resource.`, "`dbtcloud_project_connection`", "`dbtcloud_bigquery_connection`")

func ResourceConnection() *schema.Resource {
return &schema.Resource{
CreateContext: resourceConnectionCreate,
ReadContext: resourceConnectionRead,
UpdateContext: resourceConnectionUpdate,
DeleteContext: resourceConnectionDelete,

Description: docs,
Description: helper.DocString(
`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.`,
),
DeprecationMessage: "Please replace this resource with a `dbtcloud_global_connection` resource. This resource type will be removed in the next major release.",

Schema: map[string]*schema.Schema{
"connection_id": {
8 changes: 7 additions & 1 deletion pkg/sdkv2/resources/fabric_connection.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (
"strings"

"github.com/dbt-labs/terraform-provider-dbtcloud/pkg/dbt_cloud"
"github.com/dbt-labs/terraform-provider-dbtcloud/pkg/helper"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
@@ -17,7 +18,12 @@ func ResourceFabricConnection() *schema.Resource {
UpdateContext: resourceFabricConnectionUpdate,
DeleteContext: resourceFabricConnectionDelete,

Description: "Resource to create Microsoft Fabric connections in dbt Cloud",
Description: helper.DocString(
`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.`,
),
DeprecationMessage: "Please replace this resource with a `dbtcloud_global_connection` resource. This resource type will be removed in the next major release.",
Schema: map[string]*schema.Schema{
"connection_id": {
Type: schema.TypeInt,