dbt-labs / terraform-provider-dbtcloud

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

Deployment_type argument appears to be redundant #209

Closed LeoTheGriff closed 8 months ago

LeoTheGriff commented 8 months ago

Provider version: dbt-labs/dbtcloud v0.2.2

Terraform:

resource "dbtcloud_environment" "data_platform_test_production" {
  dbt_version     = "1.6.1-latest" # TODO: parameterise as a variable, ideally get from dbt/requirements.txt
  name            = "Production"
  type            = "deployment"
  deployment_type = "production"
  project_id      = dbtcloud_project.data_platform_test.id
}

Output:

dbt-cloud % terraform plan
╷
│ Error: Unsupported argument
│ 
│   on main.tf line 45, in resource "dbtcloud_environment" "data_platform_test_production":
│   45:   deployment_type = "production"
│ 
│ An argument named "deployment_type" is not expected here.

Workaround: Omit deployment_type argument from terraform configuration

Proposed fix (assuming this is from new feature development): Refactor docs and guidance to reflect appropriate handling: https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs/resources/environment

b-per commented 8 months ago

Hi @LeoTheGriff !

The deployment_type is a field that was not available in 0.2.2 but was added later.

If you use an older version of the provider, just check that the correct one is selected when you navigate the docs.

LeoTheGriff commented 8 months ago

Thank you for spotting that!