Skip to content

Commit 33d3fc6

Browse files
authored
feat: added group_policy_configuration, group_policy_boolean_value and group_policy_test_value as new resources (#762)
# Pull Request Description ## Summary [Provide a brief description of the changes in this PR] ### Issue Reference Fixes #[Issue Number] ### Motivation and Context - Why is this change needed? - What problem does it solve? - If it fixes an open issue, please link to the issue here ### Dependencies - List any dependencies that are required for this change - Include any configuration changes needed - Note any version updates required ## Type of Change Please mark the relevant option with an `x`: - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 📝 Documentation update (Wiki/README/Code comments) - [ ] ♻️ Refactor (code improvement without functional changes) - [ ] 🎨 Style update (formatting, renaming) - [ ] 🔧 Configuration change - [ ] 📦 Dependency update ## Testing - [ ] I have added unit tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] I have tested this code in the following browsers/environments: [list environments] ## Quality Checklist - [ ] I have reviewed my own code before requesting review - [ ] I have verified there are no other open Pull Requests for the same update/change - [ ] All CI/CD pipelines pass without errors or warnings - [ ] My code follows the established style guidelines of this project - [ ] I have added necessary documentation (if appropriate) - [ ] I have commented my code, particularly in complex areas - [ ] I have made corresponding changes to the README and other relevant documentation - [ ] My changes generate no new warnings - [ ] I have performed a self-review of my own code - [ ] My code is properly formatted according to project standards ## Screenshots/Recordings (if appropriate) [Add screenshots or recordings that demonstrate the changes] ## Additional Notes [Add any additional information that might be helpful for reviewers]
2 parents aefc44b + 46c4004 commit 33d3fc6

File tree

47 files changed

+5899
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5899
-23
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
page_title: "microsoft365_graph_beta_device_management_group_policy_boolean_value Resource - terraform-provider-microsoft365"
3+
subcategory: "Groups"
4+
description: |-
5+
Manages group policy presentation boolean values in Microsoft Intune using the /deviceManagement/groupPolicyConfigurations/{groupPolicyConfigurationId}/definitionValues/{groupPolicyDefinitionValueId}/presentationValues endpoint. This resource represents multiple boolean values for group policy presentations such as checkboxes or radio buttons within a single policy definition.
6+
---
7+
8+
# microsoft365_graph_beta_device_management_group_policy_boolean_value (Resource)
9+
10+
Manages group policy presentation boolean values in Microsoft Intune using the `/deviceManagement/groupPolicyConfigurations/{groupPolicyConfigurationId}/definitionValues/{groupPolicyDefinitionValueId}/presentationValues` endpoint. This resource represents multiple boolean values for group policy presentations such as checkboxes or radio buttons within a single policy definition.
11+
12+
## Microsoft Documentation
13+
14+
- [Group policy boolean value resource type](https://learn.microsoft.com/en-us/graph/api/resources/intune-grouppolicy-grouppolicypresentationvalueboolean?view=graph-rest-beta)
15+
- [Create Group policy boolean value](https://learn.microsoft.com/en-us/graph/api/intune-grouppolicy-grouppolicypresentationvalueboolean-create?view=graph-rest-beta)
16+
- [Update Group policy boolean value](https://learn.microsoft.com/en-us/graph/api/intune-grouppolicy-grouppolicypresentationvalueboolean-update?view=graph-rest-beta)
17+
- [Delete Group policy boolean value](https://learn.microsoft.com/en-us/graph/api/intune-grouppolicy-grouppolicypresentationvalueboolean-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+
resource "microsoft365_graph_beta_device_management_group_policy_boolean_value" "allow_users_to_contact_microsoft_for_feedback_and_support" {
37+
group_policy_configuration_id = microsoft365_graph_beta_device_management_group_policy_configuration.example_with_assignments.id
38+
policy_name = "Allow users to contact Microsoft for feedback and support"
39+
class_type = "machine"
40+
category_path = "\\OneDrive"
41+
enabled = true
42+
43+
values = [
44+
{
45+
value = true # Send Feedback - 1st gui value
46+
},
47+
{
48+
value = true # Receive user satisfication surveys - 2nd gui value
49+
},
50+
{
51+
value = false # Contact OneDrive Support​ - 3rd gui value
52+
}
53+
]
54+
55+
timeouts = {
56+
create = "10m"
57+
read = "5m"
58+
update = "10m"
59+
delete = "5m"
60+
}
61+
}
62+
```
63+
64+
<!-- schema generated by tfplugindocs -->
65+
## Schema
66+
67+
### Required
68+
69+
- `category_path` (String) The category path of the group policy definition (e.g., '\FSLogix\Profile Containers', '\FSLogix\ODFC Containers'). Used to distinguish between policies with the same name in different categories
70+
- `class_type` (String) The class type of the group policy definition. Must be 'user' or 'machine'
71+
- `enabled` (Boolean) Whether the group policy setting is enabled or disabled
72+
- `group_policy_configuration_id` (String) The unique identifier of the group policy configuration that contains this presentation value
73+
- `policy_name` (String) The display name of the group policy definition (e.g., 'Allow automatic full screen on specified sites')
74+
- `values` (Attributes List) List of boolean presentation values for this group policy definition. Each presentation corresponds to a different checkbox or setting within the policy. (see [below for nested schema](#nestedatt--values))
75+
76+
### Optional
77+
78+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
79+
80+
### Read-Only
81+
82+
- `created_date_time` (String) The date and time when the presentation value was created
83+
- `group_policy_definition_value_id` (String) The unique identifier of the group policy definition value instance within the configuration (resolved automatically from policy_name and class_type)
84+
- `id` (String) The unique identifier for the group policy definition value (not individual presentation values)
85+
- `last_modified_date_time` (String) The date and time when the presentation value was last modified
86+
87+
<a id="nestedatt--values"></a>
88+
### Nested Schema for `values`
89+
90+
Required:
91+
92+
- `value` (Boolean) The boolean value for this specific presentation
93+
94+
Optional:
95+
96+
- `presentation_id` (String) The unique identifier of the group policy presentation template. If not provided, presentations will be auto-resolved in order.
97+
98+
99+
<a id="nestedatt--timeouts"></a>
100+
### Nested Schema for `timeouts`
101+
102+
Optional:
103+
104+
- `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).
105+
- `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.
106+
- `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.
107+
- `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).
108+
109+
## Important Notes
110+
111+
- **Resource Structure**: this resource deploys a text value for a group policy configuration.
112+
It has a hard dependency on the group policy configuration resource.
113+
- **Authoring**: The policy name, class type, and category path must match what's defined in the Intune gui. The Provider
114+
will resolve the correct template and presentation IDs for you. The boolean values should be in defined in the HCL
115+
as to the order within the gui.
116+
117+
## Import
118+
119+
Import is supported using the following syntax:
120+
121+
```shell
122+
#!/bin/bash
123+
# Import using the group policy boolean value ID
124+
terraform import microsoft365_graph_beta_device_management_group_policy_boolean_value.example 00000000-0000-0000-0000-000000000000
125+
```
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "microsoft365_graph_beta_device_management_group_policy_multi_text_value Resource - terraform-provider-microsoft365"
4+
subcategory: ""
5+
description: |-
6+
Manages group policy presentation text values in Microsoft Intune using the /deviceManagement/groupPolicyConfigurations/{groupPolicyConfigurationId}/definitionValues/{groupPolicyDefinitionValueId}/presentationValues endpoint. This resource represents a text value for group policy presentations such as text boxes, combo boxes, or drop-down lists.
7+
---
8+
9+
# microsoft365_graph_beta_device_management_group_policy_multi_text_value (Resource)
10+
11+
Manages group policy presentation text values in Microsoft Intune using the `/deviceManagement/groupPolicyConfigurations/{groupPolicyConfigurationId}/definitionValues/{groupPolicyDefinitionValueId}/presentationValues` endpoint. This resource represents a text value for group policy presentations such as text boxes, combo boxes, or drop-down lists.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `category_path` (String) The category path of the group policy definition (e.g., '\FSLogix\Profile Containers', '\FSLogix\ODFC Containers'). Used to distinguish between policies with the same name in different categories
21+
- `class_type` (String) The class type of the group policy definition. Must be 'user' or 'machine'
22+
- `enabled` (Boolean) Whether the group policy setting is enabled or disabled
23+
- `group_policy_configuration_id` (String) The unique identifier of the group policy configuration that contains this presentation value
24+
- `policy_name` (String) The display name of the group policy definition (e.g., 'Allow automatic full screen on specified sites')
25+
- `values` (Set of String) A set of text values for the multi-text group policy setting
26+
27+
### Optional
28+
29+
- `presentation_index` (Number) The index of the presentation to use if multiple presentations exist for the policy (default: 0 - first suitable text presentation)
30+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
31+
32+
### Read-Only
33+
34+
- `created_date_time` (String) The date and time when the presentation value was created
35+
- `group_policy_definition_value_id` (String) The unique identifier of the group policy definition value instance within the configuration (resolved automatically from policy_name and class_type)
36+
- `id` (String) The unique identifier for the group policy presentation text value
37+
- `last_modified_date_time` (String) The date and time when the presentation value was last modified
38+
- `presentation_id` (String) The unique identifier of the group policy presentation template (resolved automatically from the policy definition and presentation_index)
39+
40+
<a id="nestedatt--timeouts"></a>
41+
### Nested Schema for `timeouts`
42+
43+
Optional:
44+
45+
- `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).
46+
- `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.
47+
- `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.
48+
- `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).

0 commit comments

Comments
 (0)