Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 2.75 KB

UPGRADING_PROVIDER.md

File metadata and controls

70 lines (52 loc) · 2.75 KB

Upgrading from the GtheSheep Provider

As of (6/14/2023) the provider has been transferred from the dbt community member Gary James [GtheSheep] to dbt-labs.

To upgrade from the community provider to the dbt-labs one, please run the following command:

terraform state replace-provider GtheSheep/dbt-cloud dbt-labs/dbtcloud

You should also update your lock file / Terraform provider version pinning. From the deprecated source:

# deprecated source
terraform {
  required_providers {
    dbt = {
      source  = "GtheSheep/dbt-cloud"
      version = "0.1.11"
    }
  }
}

To new source:

# new source
terraform {
  required_providers {
    dbt = {
      source  = "dbt-labs/dbtcloud"
      version = "0.1.12"
    }
  }
}

To change version of the provider please also run the following command

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
    2. edit the resource configuration files changing resources from dbt_cloud_xxx to dbtcloud_xxx
    3. edit required_providers { dbt = { and provider "dbt" to required_providers { dbtcloud = { and provider "dbtcloud"
    4. pull the remote state with terraform state pull > remote_state.tfstate and keep a back up of the file
    5. edit the state file to change the resource types from dbt_cloud_xxx to dbtcloud_xxx
    6. push the state back with terraform state push remote_state.tfstate
    7. perform a terraform init -upgrade to update the terraform provider
    8. perform a terraform plan to check that no change is required, you can then delete the backup of the state