hashicorp / terraform-provider-azuread

Terraform provider for Azure Active Directory
https://registry.terraform.io/providers/hashicorp/azuread/latest/docs
Mozilla Public License 2.0
415 stars 280 forks source link

Add option to configure azuread_privileged_access_group_role #1404

Closed tehho closed 3 weeks ago

tehho commented 3 weeks ago

Community Note

Description

When creating a azuread_privileged_access_group_eligibility_schedule there is no option to modify the "Activation maximum duration (hours)" of the role. Suggesting adding a new resource that modifies the role as specified.

New or Affected Resource(s)

Potential Terraform Configuration

data "azuread_group" "this" {
  display_name = "<your-group-name>"
}

resource "azuread_group" "this" {
  display_name     = replace("PIM-${data.azuread_group.this.name}", " ", "-")
  description      = "PIM example for ${data.azuread_group.this.display_name}"
  security_enabled = true
}

resource "azuread_privileged_access_group_role" "member" {
  display_name = "member"
  max_duration = "PT1H"
  # follow entra id specification for parameters
}

resource "azuread_privileged_access_group_eligibility_schedule" "this" {
  group_id             = azuread_group.this.id
  principal_id         = data.azuread_group.this.id
  assignment_type      = azuread_privileged_access_group_role.member.display_name
  permanent_assignment = true
  justification        = "as requested"
}

References

tehho commented 3 weeks ago

I think it is azuread_group_role_management_policy that I'm asking for. Silly me not knowing ms graph totally structured resource definitions