jdamata / terraform-provider-sonarqube

Terraform provider for managing Sonarqube configuration
GNU General Public License v3.0
62 stars 50 forks source link

sonarqube_github_binding not replaced if sonarqube project it is attached to is replaced #260

Open deepbrook opened 3 weeks ago

deepbrook commented 3 weeks ago

When Terraform recreates a sonarqube project, any attached github bindings are not recreated automatically, causing an error on the next plan action.

Terraform Version

1.8.4

Affected Resource(s)

Terraform Configuration Files

resource sonarqube_project "this" {
  key = "my-project"
  name = "My Project"
}

resource sonarqube_github_binding "this" {
  project = sonarqube_project.this.key
  alm_key = "github"
}

Expected Behavior

If the SonarQube project is marked for replacement, the sonarqub_github_binding should be marked for replacement, too.

Actual Behavior

The binding isn't marked and the apply action runs to completion. Upon the next plan action, the sonarqube_github_binding resource raises an error, stating the target project isnt bound to any github integration.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. modify the name attribute
  3. terraform apply - the project is replaced
  4. terraform plan - the binding resource raises an error, because it cannot find the project it was bound to.
smokedlinq commented 5 days ago

This same behavior is if the sonarqube_alm_github resource is replaced because of key/secret rotation.