Skip to content

Commit

Permalink
Merge pull request #151 from dbt-labs/rename-resources-v0.2.0
Browse files Browse the repository at this point in the history
Rename resources and release v0.2.0
  • Loading branch information
b-per authored Jun 19, 2023
2 parents d1e245c + 82727a2 commit 859a122
Show file tree
Hide file tree
Showing 128 changed files with 1,332 additions and 1,069 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

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

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

## [0.2.0](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.1.12...v0.2.0)

## Important changes

- The resources and data sources are now available as `dbtcloud_xxx` (following the terraform convention) in addition to `dbt_cloud_xxx` (legacy). The legacy version will be removed from v0.3.0 onwards. Instructions on how to use the new resources are available on [the main page of the Provider](https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs).

## 0.1.12

## Changes

- The provider is now published under the dbt-labs org: https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This repo was originally created by a dbt community member, Gary James [[GtheSheep](https://github.com/GtheSheep)]

| If you are still using the GtheSheep/dbt-cloud source, see [Upgrading from the community Provider](UPGRADING_PROVIDER.md) to upgrade to the latest version.
> If you are still using the GtheSheep/dbt-cloud source, see [Upgrading from the community Provider](UPGRADING_PROVIDER.md) to upgrade to the latest version.
## Scope

Expand All @@ -17,7 +17,7 @@ setup, with the latest version number.
```terraform
terraform {
required_providers {
dbt = {
dbtcloud = {
source = "dbt-labs/dbtcloud"
version = "<version>"
}
Expand All @@ -32,10 +32,11 @@ can do so as below, though likely via a `variables.tf` file or config in your
CI-CD pipeline to keep these credentials safe.

```terraform
provider "dbt" {
provider "dbtcloud" {
// required
account_id = ...
token = "..."
// optional
host_url = "..."
}
```
Expand All @@ -58,5 +59,5 @@ own account

## Acknowledgement

Thanks to Gary James [[GtheSheep](https://github.com/GtheSheep)], for all the effort put in creating this provier originally
Thanks to Gary James [[GtheSheep](https://github.com/GtheSheep)], for all the effort put in creating this provider originally
and for being a great dbt community member!
25 changes: 25 additions & 0 deletions UPGRADING_PROVIDER.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,28 @@ terraform init -upgrade
```

>**Note**: 0.1.12 is the first version published after the transfer. For earlier versions, please continue using the GtheSheep/dbt-cloud source

# Upgrading from the `dbt_cloud_xxx` resources to the `dbtcloud_xxx` ones

With version 0.2, resources and data sources are both available as `dbt_cloud_xxx` (legacy) and `dbtcloud_xxx` (preferred, following the Terraform convention).

- `dbt_cloud_xxx` is kept in 0.2 for backward compatibility, but will be removed from version 0.3 onwards. Consider starting new projects with the `dbtcloud_xxx` naming convention
- `dbtcloud_xxx` follows the Terraform naming convention and is the long term convention for the dbt Cloud configuration

## Handling the move from `dbt_cloud_xxx` (legacy) to `dbtcloud_xxx`

As those are different resources, it is not possible to move existing resources using the `terraform state mv` command.

The options are:

- keep existing projects with `dbt_cloud_xxx` resources, and create new ones with `dbtcloud_xxx`
- or update the state file manually to change the resource names (this should work but it is possible to corrupt the state, be careful and keep a backup)
1. perform a `terraform apply` to apply the changes required to dbt Cloud
1. edit the resource configuration files changing resources from `dbt_cloud_xxx` to `dbtcloud_xxx`
1. edit `required_providers { dbt = {` and `provider "dbt"` to `required_providers { dbtcloud = {` and `provider "dbtcloud"`
1. pull the remote state with `terraform state pull > remote_state.tfstate` and keep a back up of the file
1. edit the state file to change the resource types from `dbt_cloud_xxx` to `dbtcloud_xxx`
1. push the state back with `terraform state push remote_state.tfstate`
1. perform a `terraform init -upgrade` to update the terraform provider
1. perform a `terraform plan` to check that no change is required, you can then delete the backup of the state
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.12
0.2.0
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_bigquery_connection Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_bigquery_connection Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_bigquery_connection (Data Source)
# dbtcloud_bigquery_connection (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_bigquery_credential Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_bigquery_credential Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_bigquery_credential (Data Source)
# dbtcloud_bigquery_credential (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_connection Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_connection Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_connection (Data Source)
# dbtcloud_connection (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_databricks_credential Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_databricks_credential Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_databricks_credential (Data Source)
# dbtcloud_databricks_credential (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_environment Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_environment Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_environment (Data Source)
# dbtcloud_environment (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_environment_variable Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_environment_variable Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_environment_variable (Data Source)
# dbtcloud_environment_variable (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_group Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_group Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_group (Data Source)
# dbtcloud_group (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_job Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_job Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_job (Data Source)
# dbtcloud_job (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_postgres_credential Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_postgres_credential Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_postgres_credential (Data Source)
# dbtcloud_postgres_credential (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_privatelink_endpoint Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_privatelink_endpoint Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_privatelink_endpoint (Data Source)
# dbtcloud_privatelink_endpoint (Data Source)



## Example Usage

```terraform
data "dbt_cloud_privatelink_endpoint" "test_with_name" {
// use dbt_cloud_privatelink_endpoint instead of dbtcloud_privatelink_endpoint for the legacy resource names
// legacy names will be removed from 0.3 onwards
data "dbtcloud_privatelink_endpoint" "test_with_name" {
name = "My Endpoint Name"
}
data "dbt_cloud_privatelink_endpoint" "test_with_url" {
data "dbtcloud_privatelink_endpoint" "test_with_url" {
private_link_endpoint_url = "abc.privatelink.def.com"
}
// in case multiple endpoints have the same name or URL
data "dbt_cloud_privatelink_endpoint" "test_with_name_and_url" {
data "dbtcloud_privatelink_endpoint" "test_with_name_and_url" {
name = "My Endpoint Name"
private_link_endpoint_url = "abc.privatelink.def.com"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_project Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_project Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_project (Data Source)
# dbtcloud_project (Data Source)



## Example Usage

```terraform
data "dbt_cloud_project" "test_project" {
// use dbt_cloud_project instead of dbtcloud_project for the legacy resource names
// legacy names will be removed from 0.3 onwards
data "dbtcloud_project" "test_project" {
project_id = var.dbt_cloud_project_id
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_repository Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_repository Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_repository (Data Source)
# dbtcloud_repository (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_service_token Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_service_token Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_service_token (Data Source)
# dbtcloud_service_token (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_snowflake_credential Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_snowflake_credential Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_snowflake_credential (Data Source)
# dbtcloud_snowflake_credential (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_user Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_user Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_user (Data Source)
# dbtcloud_user (Data Source)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dbt_cloud_webhook Data Source - terraform-provider-dbtcloud"
page_title: "dbtcloud_webhook Data Source - dbtcloud"
subcategory: ""
description: |-
---

# dbt_cloud_webhook (Data Source)
# dbtcloud_webhook (Data Source)



Expand Down
Loading

0 comments on commit 859a122

Please sign in to comment.