resource "sonarqube_user_token" "project_analysis_token" {
for_each = { for item in var.project_analysis_token_name : "${item.name}-${item.project_key}" => item }
name = each.value.name
type = "PROJECT_ANALYSIS_TOKEN"
project_key = each.value.project_key
login_name = var.bot_user
}
Expected Behavior
Create a project analysis token for the bot_user.
Actual Behavior
│ Error: resourceSonarqubeUserTokenCreate: Failed to find user token: app-12345-bot-user/app-12345-java-app-token
│
│ with sonarqube_user_token.project_analysis_token["app-12345-java-app-token-app-12345-java-app"],
│ on main.tf line 32, in resource "sonarqube_user_token" "project_analysis_token":
│ 32: resource "sonarqube_user_token" "project_analysis_token" {
│
╵
╷
│ Error: resourceSonarqubeUserTokenCreate: Failed to find user token: app-12345-bot-user/app-12345-python-app-token
│
│ with sonarqube_user_token.project_analysis_token["app-12345-python-app-token-app-12345-python-app"],
│ on main.tf line 32, in resource "sonarqube_user_token" "project_analysis_token":
│ 32: resource "sonarqube_user_token" "project_analysis_token" {
This error suggests that the token does not exist, this is true because I am trying to create it now.
For some reason, it failed at resourceSonarqubeUserTokenRead
return fmt.Errorf("resourceSonarqubeUserTokenCreate: Failed to find user token: %+v", d.Id())
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
add login_name to resource sonarqube_user_token and type "PROJECT_ANALYSIS_TOKEN"
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
Expected Behavior
Create a project analysis token for the bot_user.
Actual Behavior
This error suggests that the token does not exist, this is true because I am trying to create it now.
For some reason, it failed at resourceSonarqubeUserTokenRead
return fmt.Errorf("resourceSonarqubeUserTokenCreate: Failed to find user token: %+v", d.Id())
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
add login_name to resource sonarqube_user_token and type "PROJECT_ANALYSIS_TOKEN"
References
None
Thanks!