jdamata / terraform-provider-sonarqube

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

Error Creating Project Analysis Token when login_name parameter is provided. #223

Closed romanlytovchenko closed 4 months ago

romanlytovchenko commented 7 months ago

Hi there,

Thank you for opening an issue.

Terraform Version

Terraform v1.5.7

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "sonarqube_user_token" "sonarqube_user_token" {
  name            = "name"
  type            = "PROJECT_ANALYSIS_TOKEN"
  project_key     = "project_key"
  expiration_date = "2023-12-21"
  login_name      = "login_name"
}

Expected Behavior

The resource is created.

Actual Behavior

"resourceSonarqubeUserTokenCreate: Failed to find user token" happens. Is it possible this error comes in https://github.com/jdamata/terraform-provider-sonarqube/blob/51ae1fa8bf20dd0179c2dc953688cd8231723a33/sonarqube/resource_sonarqube_user_token.go#L107 due "login_name" attribute is set for USER_TOKEN type only?

Steps to Reproduce

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

  1. terraform apply

References

Not clear for me why #204 was closed.

freeranger commented 4 months ago

Hi @romanlytovchenko - see my comment here: https://github.com/jdamata/terraform-provider-sonarqube/pull/238#issuecomment-1908163540 You cannot create project or global analysis tokens for other users - closing this issue as there is no action to take