Azure / terraform-azurerm-avm-res-authorization-roleassignment

AVM Terraform module for role assignments
https://registry.terraform.io/modules/Azure/avm-res-authorization-roleassignment
MIT License
4 stars 2 forks source link

[AVM Module Issue]: unable to use role assignments for resources #46

Open rick-pb opened 1 month ago

rick-pb commented 1 month ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

0.0.1

(Optional) Correlation Id

No response

Description

when trying to apply the following module: module "role_assignments" { source = "Azure/avm-res-authorization-roleassignment/azurerm" version = "0.0.1"

groups_by_display_name = { group1 = "Example Group" }

role_definitions = { contributor = "Contributor" }

role_assignments_for_resources = { example1 = { resource_name = "kv-example" resource_group_name = "rg-example" role_assignments = { role_assignment_1 = { role_definition = "contributor" groups = ["group1"] } } }

} }

I'm receiving the following error:

│ Error: Invalid index │ │ on .terraform/modules/role_assignments/local.role.assignments.for.resources.tf line 39, in locals: │ 39: scope = data.azurerm_resources.resources_by_resource_group_and_name[key].resources[0].id │ ├──────────────── │ │ data.azurerm_resources.resources_by_resource_group_and_name is object with 1 attribute "example1" │ │ The given key does not identify an element in this collection value: the collection has no elements.

although I'm pretty sure my module is valid?

microsoft-github-policy-service[bot] commented 1 month ago

[!IMPORTANT] The "Needs: Triage :mag:" label must be removed once the triage process is complete!

[!NOTE] This label was added as per ITA06.

microsoft-github-policy-service[bot] commented 1 month ago

[!NOTE] The "Type: Bug :bug:" label was added as per ITA21.