|
| 1 | +--- |
| 2 | +page_title: "microsoft365_graph_beta_device_management_group_policy_category Data Source - terraform-provider-microsoft365" |
| 3 | +subcategory: "Device Management" |
| 4 | + |
| 5 | +description: |- |
| 6 | + This data source retrieves comprehensive information about a specific Group Policy setting by performing three sequential Microsoft Graph API calls: |
| 7 | + GET /deviceManagement/groupPolicyCategories?$expand=parent,definitions&$select=id,displayName,isRoot,ingestionSource - Retrieves all categories with their definitionsGET /deviceManagement/groupPolicyDefinitions('{id}') - Gets detailed information about the specific policy definitionGET /deviceManagement/groupPolicyDefinitions('{id}')/presentations - Retrieves all presentation configurations for the policy |
| 8 | + The data source consolidates information from all three API calls into a single Terraform resource, making it easy to access category details, policy definitions, and presentation configurations (including dropdown options, text boxes, checkboxes, etc.) for a given Group Policy setting. |
| 9 | + Permissions |
| 10 | + One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions https://docs.microsoft.com/en-us/graph/permissions-reference. |
| 11 | + |Permission type|Permissions (from least to most privileged)| |
| 12 | + |:---|:---| |
| 13 | + |Delegated (work or school account)|DeviceManagementConfiguration.Read.All, DeviceManagementConfiguration.ReadWrite.All| |
| 14 | + |Delegated (personal Microsoft account)|Not supported.| |
| 15 | + |Application|DeviceManagementConfiguration.Read.All, DeviceManagementConfiguration.ReadWrite.All| |
| 16 | +--- |
| 17 | + |
| 18 | +# microsoft365_graph_beta_device_management_group_policy_category (Data Source) |
| 19 | + |
| 20 | +The Microsoft 365 Intune group policy category data source returns detailed information on every available group |
| 21 | +policy available for configuration. This data source supports a search by group policy name and will return all matching |
| 22 | +group policies, there settings and presentations. PResentations in this context, means the possible configuration choices |
| 23 | +that are support for a given group policy setting. |
| 24 | + |
| 25 | +## Microsoft Documentation |
| 26 | + |
| 27 | +- [groupPolicyCategory resource type](https://learn.microsoft.com/en-us/graph/api/resources/intune-grouppolicy-grouppolicycategory?view=graph-rest-beta) |
| 28 | + |
| 29 | +## API Permissions |
| 30 | + |
| 31 | +The following API permissions are required in order to use this data source. |
| 32 | + |
| 33 | +### Microsoft Graph |
| 34 | + |
| 35 | +- **Application**: `DeviceManagementConfiguration.Read.All` |
| 36 | + |
| 37 | +## Version History |
| 38 | + |
| 39 | +| Version | Status | Notes | |
| 40 | +|---------|--------|-------| |
| 41 | +| v0.29.0-alpha | Experimental | Initial release | |
| 42 | + |
| 43 | +## Example Usage |
| 44 | + |
| 45 | +```terraform |
| 46 | +# Get the WSL networking configuration setting |
| 47 | +data "microsoft365_graph_beta_device_management_group_policy_category" "wsl_networking" { |
| 48 | + setting_name = "Configure default networking mode" // Define the group policy item you wish to return |
| 49 | +
|
| 50 | + timeouts = { |
| 51 | + read = "5m" |
| 52 | + } |
| 53 | +} |
| 54 | +
|
| 55 | +# Output the complete data structure |
| 56 | +output "wsl_networking_setting" { |
| 57 | + description = "Complete group policy setting information from all three API calls" |
| 58 | + value = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking |
| 59 | +} |
| 60 | +
|
| 61 | +# Access group policy top tier list |
| 62 | +output "category_info" { |
| 63 | + description = "Category information from the first API call" |
| 64 | + value = { |
| 65 | + id = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.category.id |
| 66 | + display_name = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.category.display_name |
| 67 | + is_root = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.category.is_root |
| 68 | + ingestion_source = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.category.ingestion_source |
| 69 | + parent_category = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.category.parent |
| 70 | + } |
| 71 | +} |
| 72 | +
|
| 73 | +# Access group policy definition by id (from 2nd API call) |
| 74 | +output "definition_info" { |
| 75 | + description = "Detailed policy definition from the second API call" |
| 76 | + value = { |
| 77 | + id = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.id |
| 78 | + display_name = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.display_name |
| 79 | + explain_text = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.explain_text |
| 80 | + category_path = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.category_path |
| 81 | + class_type = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.class_type |
| 82 | + policy_type = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.policy_type |
| 83 | + version = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.version |
| 84 | + has_related_definitions = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.has_related_definitions |
| 85 | + group_policy_category_id = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.group_policy_category_id |
| 86 | + min_device_csp_version = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.min_device_csp_version |
| 87 | + min_user_csp_version = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.min_user_csp_version |
| 88 | + supported_on = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.supported_on |
| 89 | + last_modified_date_time = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.definition.last_modified_date_time |
| 90 | + } |
| 91 | +} |
| 92 | +
|
| 93 | +# Access presentation information (from 3rd API call) - now properly populated! |
| 94 | +output "presentation_info" { |
| 95 | + description = "Presentation configuration from the third API call - dropdown with options" |
| 96 | + value = { |
| 97 | + presentation_id = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].id |
| 98 | + odata_type = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].odata_type |
| 99 | + label = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].label |
| 100 | + required = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].required |
| 101 | + last_modified_date_time = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].last_modified_date_time |
| 102 | +
|
| 103 | + # Dropdown-specific properties. |
| 104 | + default_item = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].default_item |
| 105 | + available_options = data.microsoft365_graph_beta_device_management_group_policy_category.wsl_networking.presentations[0].items |
| 106 | + } |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +<!-- schema generated by tfplugindocs --> |
| 111 | +## Schema |
| 112 | + |
| 113 | +### Required |
| 114 | + |
| 115 | +- `setting_name` (String) The display name of the Group Policy setting to search for (case-insensitive) |
| 116 | + |
| 117 | +### Optional |
| 118 | + |
| 119 | +- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) |
| 120 | + |
| 121 | +### Read-Only |
| 122 | + |
| 123 | +- `category` (Attributes) The Group Policy category information from the first API call (see [below for nested schema](#nestedatt--category)) |
| 124 | +- `definition` (Attributes) The detailed Group Policy definition information from the second API call (see [below for nested schema](#nestedatt--definition)) |
| 125 | +- `id` (String) The unique identifier for this data source |
| 126 | +- `presentations` (Attributes List) The list of presentations associated with the group policy definition from the third API call (see [below for nested schema](#nestedatt--presentations)) |
| 127 | + |
| 128 | +<a id="nestedatt--timeouts"></a> |
| 129 | +### Nested Schema for `timeouts` |
| 130 | + |
| 131 | +Optional: |
| 132 | + |
| 133 | +- `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). |
| 134 | +- `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. |
| 135 | +- `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. |
| 136 | +- `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). |
| 137 | + |
| 138 | + |
| 139 | +<a id="nestedatt--category"></a> |
| 140 | +### Nested Schema for `category` |
| 141 | + |
| 142 | +Read-Only: |
| 143 | + |
| 144 | +- `display_name` (String) The display name of the category |
| 145 | +- `id` (String) The unique identifier of the category |
| 146 | +- `ingestion_source` (String) The source of the category (e.g., builtIn, custom) |
| 147 | +- `is_root` (Boolean) Indicates if the category is a root category |
| 148 | +- `parent` (Attributes) The parent category if this is not a root category (see [below for nested schema](#nestedatt--category--parent)) |
| 149 | + |
| 150 | +<a id="nestedatt--category--parent"></a> |
| 151 | +### Nested Schema for `category.parent` |
| 152 | + |
| 153 | +Read-Only: |
| 154 | + |
| 155 | +- `display_name` (String) The display name of the parent category |
| 156 | +- `id` (String) The unique identifier of the parent category |
| 157 | +- `is_root` (Boolean) Indicates if the parent category is a root category |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +<a id="nestedatt--definition"></a> |
| 162 | +### Nested Schema for `definition` |
| 163 | + |
| 164 | +Read-Only: |
| 165 | + |
| 166 | +- `category_path` (String) The category path of the definition |
| 167 | +- `class_type` (String) The class type of the definition (e.g., machine, user) |
| 168 | +- `display_name` (String) The display name of the definition |
| 169 | +- `explain_text` (String) The explanation text for the definition |
| 170 | +- `group_policy_category_id` (String) The ID of the group policy category this definition belongs to |
| 171 | +- `has_related_definitions` (Boolean) Indicates if the definition has related definitions |
| 172 | +- `id` (String) The unique identifier of the definition |
| 173 | +- `last_modified_date_time` (String) The date and time the definition was last modified |
| 174 | +- `min_device_csp_version` (String) The minimum device CSP version required |
| 175 | +- `min_user_csp_version` (String) The minimum user CSP version required |
| 176 | +- `policy_type` (String) The policy type of the definition |
| 177 | +- `supported_on` (String) The supported platforms for the definition |
| 178 | +- `version` (String) The version of the definition |
| 179 | + |
| 180 | + |
| 181 | +<a id="nestedatt--presentations"></a> |
| 182 | +### Nested Schema for `presentations` |
| 183 | + |
| 184 | +Read-Only: |
| 185 | + |
| 186 | +- `default_checked` (Boolean) Whether the checkbox is checked by default |
| 187 | +- `default_decimal_value` (Number) The default decimal value for decimal text box presentations |
| 188 | +- `default_item` (Attributes) The default item for dropdown list presentations (see [below for nested schema](#nestedatt--presentations--default_item)) |
| 189 | +- `default_value` (String) The default value for text box presentations |
| 190 | +- `explicit_value` (Boolean) Whether the user must specify the registry subkey value and name for list box presentations |
| 191 | +- `id` (String) The ID of the presentation |
| 192 | +- `items` (Attributes List) The list of items for dropdown list presentations (see [below for nested schema](#nestedatt--presentations--items)) |
| 193 | +- `label` (String) The localized text label for the presentation |
| 194 | +- `last_modified_date_time` (String) The date and time the entity was last modified |
| 195 | +- `max_length` (Number) The maximum length for text box presentations |
| 196 | +- `max_value` (Number) The maximum value for decimal text box presentations |
| 197 | +- `min_value` (Number) The minimum value for decimal text box presentations |
| 198 | +- `odata_type` (String) The OData type of the presentation (e.g., #microsoft.graph.groupPolicyPresentationDropdownList) |
| 199 | +- `required` (Boolean) Whether a value is required for the parameter box (if applicable) |
| 200 | +- `spin` (Boolean) Whether spin controls are enabled for decimal text box presentations |
| 201 | +- `spin_step` (Number) The spin step for decimal text box presentations |
| 202 | +- `value_prefix` (String) The value prefix for list box presentations |
| 203 | + |
| 204 | +<a id="nestedatt--presentations--default_item"></a> |
| 205 | +### Nested Schema for `presentations.default_item` |
| 206 | + |
| 207 | +Read-Only: |
| 208 | + |
| 209 | +- `display_name` (String) The display name of the default item |
| 210 | +- `value` (String) The value of the default item |
| 211 | + |
| 212 | + |
| 213 | +<a id="nestedatt--presentations--items"></a> |
| 214 | +### Nested Schema for `presentations.items` |
| 215 | + |
| 216 | +Read-Only: |
| 217 | + |
| 218 | +- `display_name` (String) The display name of the item |
| 219 | +- `value` (String) The value of the item |
0 commit comments