Open isehuetdk opened 7 months ago
Module azurerm_role_assignment already supports this functionality.
This should be added for both eligible and active PIM assignments. As already mentioned, it is included in standard role assignments.
I need this functionality as well. I can offer a Pull Request, if no one is already on it.
Is there an existing issue for this?
Community Note
Description
I would like to add conditions to my PIM assignment as in https://learn.microsoft.com/en-us/azure/templates/microsoft.authorization/roleeligibilityschedulerequests?pivots=deployment-language-terraform to restrict certain permissions, e.g. allow access management for high privileged roles.
This feature is currently not supported in
azurerm_pim_eligible_role_assignment
version 3.97.1.Also added as request/note here https://github.com/hashicorp/terraform-provider-azurerm/issues/23458#issuecomment-1954334534
Using the azapi to deploy this using "Microsoft.Authorization/roleEligibilityScheduleRequests@2022-04-01-preview" does not resolve the issue due to https://github.com/hashicorp/terraform-provider-azurerm/issues/22513 that throws an error 400 when redeploying an existing PIM assignment. Furthermore, the API does not support destroy function to remove the assignment through code.
New or Affected Resource(s)/Data Source(s)
azurerm_pim_eligible_role_assignment
Potential Terraform Configuration
References
No response