Skip to content

dbtcloud_repository resource produces inconsistent result with git_clone_strategy during apply #507

@VuKrampHub

Description

@VuKrampHub

Describe the bug

The dbtcloud_repository resource produces an inconsistent result during terraform apply. The git_clone_strategy attribute is configured as "github_app" but the provider returns "deploy_key" after creation, causing Terraform to report a provider bug.

Error message

Error: Provider produced inconsistent result after apply  

When applying changes to  
module.service.module.dbt_cloud_project[0].dbtcloud_repository.default,  
provider "provider[\"registry.terraform.io/dbt-labs/dbtcloud\"]" produced an  
unexpected new value: .git_clone_strategy: was cty.StringVal("github_app"),  
but now cty.StringVal("deploy_key").  

This is a bug in the provider, which should be reported in the provider's own  
issue tracker.

Resource configuration

resource "dbtcloud_repository" "default" {
  project_id             = dbtcloud_project.default.id
  remote_url             = <valid_github_url>
  github_installation_id = <valid_github_installation_id>
  git_clone_strategy     = "github_app"
}

Expected behavior

The git_clone_strategy should remain as "github_app" after the resource is created, matching the configured value. The provider should not change this value during the apply operation.

Config (please complete the following information):

  • dbt Cloud provider version [1.1.1] and [1.1.4]

Additional context

  • This issue occurs during terraform apply in a CI/CD pipeline recently. Previous run about 15 - 30 days ago was without such issue.
  • The resource is being created as part of a module structure
  • The repository URL uses the git:// protocol
  • The issue appears to be related to the provider's handling of the git_clone_strategy attribute, where it may be defaulting to or forcing "deploy_key" regardless of the configured value

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions