jdamata / terraform-provider-sonarqube

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

Unable to reference existing quality profile using data.sonarqube_qualityprofile #235

Open mikerodionov opened 5 months ago

mikerodionov commented 5 months ago

Hi there,

Thank you for opening an issue.

Terraform Version

terraform -v output below

Terraform v1.6.6 on linux_amd64

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

data "sonarqube_qualityprofile" "main" {
  name     = "example"
}

Expected Behavior

Provider should look up for existing profile by its name.

Actual Behavior

Terraform returns an error below - it looks like provider looks for project instead of quality profile (though putting into data block name value name of existing project does not change error).

Error: resourceSonarqubeQualityProfileRead: Failed to find project: example

Steps to Reproduce

Just try to use aforementioned data resource and runterraform apply

References

n/a

edwinvandewerf commented 3 months ago

Hello,

I'm running into the same issue. If you try to refer to a resource instead of data with an existing quality profile the project association is going to fail, although it is probably not intended to use it that way.