|
| 1 | +--- |
| 2 | +page_title: "microsoft365_graph_beta_device_management_group_policy_configuration Resource - terraform-provider-microsoft365" |
| 3 | +subcategory: "Groups" |
| 4 | +description: |- |
| 5 | + Manages group policy configurations in Microsoft Intune using the /deviceManagement/groupPolicyConfigurations endpoint. The group policy configuration entity contains the configured values for one or more group policy definitions. |
| 6 | +--- |
| 7 | + |
| 8 | +# microsoft365_graph_beta_device_management_group_policy_configuration (Resource) |
| 9 | + |
| 10 | +Manages group policy configurations in Microsoft Intune using the `/deviceManagement/groupPolicyConfigurations` endpoint. The group policy configuration entity contains the configured values for one or more group policy definitions. |
| 11 | + |
| 12 | +## Microsoft Documentation |
| 13 | + |
| 14 | +- [Group policy configuration resource type](https://learn.microsoft.com/en-us/graph/api/resources/intune-grouppolicy-grouppolicyconfiguration?view=graph-rest-beta) |
| 15 | +- [Create groupPolicyConfiguration](https://learn.microsoft.com/en-us/graph/api/intune-grouppolicy-grouppolicyconfiguration-create?view=graph-rest-beta) |
| 16 | +- [Update groupPolicyConfiguration](https://learn.microsoft.com/en-us/graph/api/intune-grouppolicy-grouppolicyconfiguration-update?view=graph-rest-beta) |
| 17 | +- [Delete groupPolicyConfiguration](https://learn.microsoft.com/en-us/graph/api/intune-grouppolicy-grouppolicyconfiguration-delete?view=graph-rest-beta) |
| 18 | + |
| 19 | +## API Permissions |
| 20 | + |
| 21 | +The following API permissions are required in order to use this resource. |
| 22 | + |
| 23 | +### Microsoft Graph |
| 24 | + |
| 25 | +- **Application**: `DeviceManagementConfiguration.Read.All`, `DeviceManagementConfiguration.ReadWrite.All` |
| 26 | + |
| 27 | +## Version History |
| 28 | + |
| 29 | +| Version | Status | Notes | |
| 30 | +|---------|--------|-------| |
| 31 | +| v0.29.0-alpha | Experimental | Initial release | |
| 32 | + |
| 33 | +## Example Usage |
| 34 | + |
| 35 | +```terraform |
| 36 | +# Example usage of the group_policy_configuration resource |
| 37 | +resource "microsoft365_graph_beta_device_management_group_policy_configuration" "example_with_assignments" { |
| 38 | + display_name = "Group Policy Configuration with Assignments" |
| 39 | + description = "Group policy configuration with assignments" |
| 40 | +
|
| 41 | + role_scope_tag_ids = ["1", "2"] |
| 42 | +
|
| 43 | +
|
| 44 | + assignments = [ |
| 45 | + # Optional: Assignment targeting all devices with include filter |
| 46 | + { |
| 47 | + type = "allDevicesAssignmentTarget" |
| 48 | + filter_id = "00000000-0000-0000-0000-000000000001" |
| 49 | + filter_type = "include" |
| 50 | + }, |
| 51 | + # Optional: Assignment targeting all licensed users with exclude filter |
| 52 | + { |
| 53 | + type = "allLicensedUsersAssignmentTarget" |
| 54 | + filter_id = "00000000-0000-0000-0000-000000000002" |
| 55 | + filter_type = "exclude" |
| 56 | + }, |
| 57 | + # Optional: Assignment targeting a specific group with include filter |
| 58 | + { |
| 59 | + type = "groupAssignmentTarget" |
| 60 | + group_id = "00000000-0000-0000-0000-000000000003" |
| 61 | + filter_id = "00000000-0000-0000-0000-000000000004" |
| 62 | + filter_type = "include" |
| 63 | + }, |
| 64 | + # Optional: Assignment targeting a specific group with exclude filter |
| 65 | + { |
| 66 | + type = "groupAssignmentTarget" |
| 67 | + group_id = "00000000-0000-0000-0000-000000000005" |
| 68 | + filter_id = "00000000-0000-0000-0000-000000000006" |
| 69 | + filter_type = "include" |
| 70 | + }, |
| 71 | + # Optional: Assignment targeting a specific group with exclude filter |
| 72 | + { |
| 73 | + type = "groupAssignmentTarget" |
| 74 | + group_id = "00000000-0000-0000-0000-000000000007" |
| 75 | + filter_id = "00000000-0000-0000-0000-000000000008" |
| 76 | + filter_type = "exclude" |
| 77 | + }, |
| 78 | + # Optional: Exclusion group assignments |
| 79 | + { |
| 80 | + type = "exclusionGroupAssignmentTarget" |
| 81 | + group_id = "00000000-0000-0000-0000-000000000009" |
| 82 | + }, |
| 83 | + { |
| 84 | + type = "exclusionGroupAssignmentTarget" |
| 85 | + group_id = "00000000-0000-0000-0000-000000000010" |
| 86 | + }, |
| 87 | + ] |
| 88 | +
|
| 89 | + timeouts = { |
| 90 | + create = "10m" |
| 91 | + read = "5m" |
| 92 | + update = "10m" |
| 93 | + delete = "5m" |
| 94 | + } |
| 95 | +} |
| 96 | +``` |
| 97 | + |
| 98 | +<!-- schema generated by tfplugindocs --> |
| 99 | +## Schema |
| 100 | + |
| 101 | +### Required |
| 102 | + |
| 103 | +- `display_name` (String) User provided name for the resource object |
| 104 | + |
| 105 | +### Optional |
| 106 | + |
| 107 | +- `assignments` (Attributes Set) Assignments for the device configuration. Each assignment specifies the target group and schedule for script execution. Supports group filters. (see [below for nested schema](#nestedatt--assignments)) |
| 108 | +- `description` (String) User provided description for the resource object |
| 109 | +- `role_scope_tag_ids` (Set of String) Set of scope tag IDs for this Group Policy Configuration. |
| 110 | +- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) |
| 111 | + |
| 112 | +### Read-Only |
| 113 | + |
| 114 | +- `created_date_time` (String) The date and time the object was created |
| 115 | +- `id` (String) The unique identifier for the group policy configuration |
| 116 | +- `last_modified_date_time` (String) The date and time the entity was last modified |
| 117 | +- `policy_configuration_ingestion_type` (String) Type of definitions configured for this policy. Possible values are: unknown, custom, builtIn, mixed, unknownFutureValue |
| 118 | + |
| 119 | +<a id="nestedatt--assignments"></a> |
| 120 | +### Nested Schema for `assignments` |
| 121 | + |
| 122 | +Required: |
| 123 | + |
| 124 | +- `type` (String) Type of assignment target. Must be one of: 'allDevicesAssignmentTarget', 'allLicensedUsersAssignmentTarget', 'groupAssignmentTarget', 'exclusionGroupAssignmentTarget'. |
| 125 | + |
| 126 | +Optional: |
| 127 | + |
| 128 | +- `filter_id` (String) ID of the filter to apply to the assignment. |
| 129 | +- `filter_type` (String) Type of filter to apply. Must be one of: 'include', 'exclude', or 'none'. |
| 130 | +- `group_id` (String) The Entra ID group ID to include or exclude in the assignment. Required when type is 'groupAssignmentTarget' or 'exclusionGroupAssignmentTarget'. |
| 131 | + |
| 132 | + |
| 133 | +<a id="nestedatt--timeouts"></a> |
| 134 | +### Nested Schema for `timeouts` |
| 135 | + |
| 136 | +Optional: |
| 137 | + |
| 138 | +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). |
| 139 | +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. |
| 140 | +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. |
| 141 | +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). |
| 142 | + |
| 143 | +## Important Notes |
| 144 | + |
| 145 | +- **Resource Structure**: this resource deploys and manages the base group policy configuration object and the assignments |
| 146 | +for it. specific configuration items are deployed as separate resources. Please see `microsoft365_graph_beta_device_management_group_policy_text_value`, |
| 147 | +`microsoft365_graph_beta_device_management_group_policy_boolean_value` for more information. |
| 148 | + |
| 149 | +## Import |
| 150 | + |
| 151 | +Import is supported using the following syntax: |
| 152 | + |
| 153 | +```shell |
| 154 | +#!/bin/bash |
| 155 | +# Import using the group policy configuration ID |
| 156 | +terraform import microsoft365_graph_beta_device_management_group_policy_configuration.example 00000000-0000-0000-0000-000000000000 |
| 157 | +``` |
0 commit comments