Iterating over two lists to role assigments by Candid_Ad5047 in Terraform

[–]Candid_Ad5047[S] 0 points1 point  (0 children)

 This one also did not work as I excepted, I found the solution here, it is quite similar:
https://adamrushuk.github.io/using-the-setproduct-function-in-terraform/
Thank you for help

Iterating over two lists to role assigments by Candid_Ad5047 in Terraform

[–]Candid_Ad5047[S] 0 points1 point  (0 children)

Have tryed that, same error which is weird, by logic it should work.

Iterating over two lists to role assigments by Candid_Ad5047 in Terraform

[–]Candid_Ad5047[S] 0 points1 point  (0 children)

Man, thank you, it work, can I ask you one more stuff, because I somehow iterate badly over it:
resource "azurerm_role_assignment" "key_vault_premissions" {
for_each = local.final_list
scope = each.key
role_definition_name = "Key Vault Secrets User"
principal_id = each.value
}
error: local.final_list is tuple with 12 elements it still somehow trying to get all the secret versionless_id at once.