Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Irrelevant name property on azurerm_kusto_database_principal_assignment? #19349

Open
1 task done
sebader opened this issue Nov 17, 2022 · 5 comments · Fixed by #19354
Open
1 task done

Irrelevant name property on azurerm_kusto_database_principal_assignment? #19349

sebader opened this issue Nov 17, 2022 · 5 comments · Fixed by #19354

Comments

@sebader
Copy link
Contributor

sebader commented Nov 17, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.3.2

AzureRM Provider Version

3.31.0

Affected Resource(s)/Data Source(s)

azurerm_kusto_database_principal_assignment

Terraform Configuration Files

resource "azurerm_kusto_database_principal_assignment" "foo" {
  name                = "AM-I-REQUIRED"
  resource_group_name = azurerm_resource_group.stamp.name
  cluster_name        = azurerm_kusto_cluster.stamp.name
  database_name       = azurerm_kusto_database.snapshots.name

  tenant_id      = data.azurerm_client_config.current.tenant_id
  principal_id   = azurerm_user_assigned_identity.foo.principal_id
  principal_type = "App"
  role           = "Viewer"
}

Debug Output/Panic Output

n/a

Expected Behaviour

No response

Actual Behaviour

azurerm_kusto_database_principal_assignment requires a property name. This is missing from the docs (although it is mentioned in the sample). But more importantly, it is not clear to me if this field is actually required?! It could just be auto-generated by Terraform like for regular RBAC assignments.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@liuwuliuyun
Copy link
Contributor

liuwuliuyun commented Nov 18, 2022

Hi @sebader , thanks for raising this issue. This property is nessesary because it is an independant azure resource. To identify a azure resource, you have to specify a name. The id of this resource is like

/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}

For the doc missing part, I have raised PR to fix that.

@sebader
Copy link
Contributor Author

sebader commented Nov 18, 2022

Ok understood. I would still opt to make it optional in the same way as for role assignments
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment

name - (Optional) A unique UUID/GUID for this Role Assignment - one will be generated if not specified. Changing this forces a new resource to be created.

@tombuildsstuff
Copy link
Contributor

@sebader

Ok understood. I would still opt to make it optional in the same way as for role assignments

Agreed, we should be generating one in the Create unless a user explicitly specifies one, would you be able to take a look into that one @liuwuliuyun?

@tombuildsstuff
Copy link
Contributor

re-opening this since we should also generate one in the create if unspecified

@liuwuliuyun
Copy link
Contributor

@sebader

Ok understood. I would still opt to make it optional in the same way as for role assignments

Agreed, we should be generating one in the Create unless a user explicitly specifies one, would you be able to take a look into that one @liuwuliuyun?

Ok, let me look into this and keep tracking that in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants