dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
82 stars 19 forks source link

DBT version 1.2.4 not supported on dbt_cloud_environment resource #104

Closed ajmunoz411 closed 1 year ago

ajmunoz411 commented 1 year ago

I'm trying to spin up a DBT environment and job using the dbt-cloud provider. However, when I try to apply my terraform plan, I'm running into the following error:

Error: POST url: https://cloud.getdbt.com........., status: 400, body: {"status":{"code":400,"is_success":false,"user_message":"The request was invalid. Please double check the provided data and try again.","developer_message":""},"data":{"dbt_version":"dbt version 1.2.4 is not supported."}} in resource "dbt_cloud_environment" "dbt_environment"

Here is my resource block in my terraform config

resource "dbt_cloud_environment" "dbt_environment" {
  dbt_version = "1.2.4"
  name        = "test_environment"
  project_id  = "projectID"
  type        = "deployment"
  is_active   = true
}

I'm using dbt-cloud provider version "0.1.4"

dbt = {
  source   = "GtheSheep/dbt-cloud"
  version   = "0.1.4"
}

I've tried changing the dbt_version value to "1.2.0", and "1.2" as well, but get the same error about the version not being supported. Is there something wrong with my config or does the terraform provider not support more recent dbt versions? Thanks!

GtheSheep commented 1 year ago

Hey, it's likely to be something like "1.2.0-latest" or something like that? Annoyingly dbt Cloud only allows dbt versions in the way that the drop-down does in the UI, and then they give it a different name instead of just the version number 🙄

ajmunoz411 commented 1 year ago

Got it, appreciate the response! Will give that a try

GtheSheep commented 1 year ago

@ajmunoz411 - Did this work ok in the end? 😸

GtheSheep commented 1 year ago

This works with dbt_versions = "1.2.0-latest", dbt Cloud versions aren't specified like core, will make a note of this in the docs