dbt-labs / terraform-provider-dbtcloud

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

Environment name is not changed #47

Closed lizdeika closed 2 years ago

lizdeika commented 2 years ago

Hi, Provider successfully created a new development environment with name "Development new2".

But it fails to update it to "Development" on another plan & apply.

Plan:

Terraform v1.0.11
on linux_amd64
Configuring remote state backend...
Initializing Terraform configuration...
dbt_cloud_environment.development: Refreshing state... [id=31429:50092]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # dbt_cloud_environment.development will be updated in-place
  ~ resource "dbt_cloud_environment" "development" {
        id                = "31429:50092"
      ~ name              = "Development new2" -> "Development"
        # (6 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Apply:

Terraform v1.0.11
on linux_amd64
Initializing plugins and modules...
dbt_cloud_environment.development: Modifying... [id=31429:50092]
dbt_cloud_environment.development: Modifications complete after 1s [id=31429:50092]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Outputs:

dbt_cloud_project_name = "Mono Data Platform"

But in the end it stays "Development new2"

GtheSheep commented 2 years ago

yeah I'm having the same issue with deleting Environments right now, the docs don't match the behaviour of the API so it's a bit of trial and error. it's not like the API fails for either, it responds with success messages but nothing happens 🤦

GtheSheep commented 2 years ago

Ok, think I've found out what's up, requires a bunch of extra keys in the request body even if they're not set, I'll add any config for them later but just making sure it works first, acceptance tests are passing for updating the name of an Env now.

Same issue may exist with Credentials, so will check them/ add acceptance tests for them tomorrow, but gonna push 0.0.72 now to verify

Thanks for finding this stuff btw!

GtheSheep commented 2 years ago

Hopefully fixed by this commit?

lizdeika commented 2 years ago

Can not test at the moment, we just did not go with using terraform for terraform cloud because of stability :|

GtheSheep commented 2 years ago

😂 sure, closing this then as it's working on my side