Skip to content

Commit e255409

Browse files
mawasilemattdot
andauthored
Adding powerplatform_environment_settings resource and datasource (#250)
* Add new Environment Settings data source * adding unit tests * Add environment settings resource and data source * adding unit tests * Squashed commit of the following: commit 34468d7 Author: Engin Polat <[email protected]> Date: Fri Mar 22 10:16:34 2024 -0700 creating languages data source (#237) * creating language data source * adding languages data source to provider * changing languages data source example to use cli to authenticate * updating model and api for languages * adding documentation * adding tests * Update ProtoV6ProviderFactories in unit test * Update ProtoV6ProviderFactories in unit test * Refactor API calls in environment settings tests * Update user.md and resource_user.go with additional resources * Refactor power platform environment settings * Add power_apps_component_framework_for_canvas_apps feature to powerplatform_environment_settings resource and datasource * Update ImportState function to use environment_id instead of id * Delete import.tf file --------- Co-authored-by: Matt Dotson <[email protected]>
1 parent 0223f4b commit e255409

24 files changed

+3682
-14
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "powerplatform_environment_settings Data Source - powerplatform"
4+
subcategory: ""
5+
description: |-
6+
Power Platform Environment Settings Data Source. Power Platform Settings are configuration options that apply to a specific environment. They control various aspects of Power Platform features and behaviors, See Environment Settings Overview https://learn.microsoft.com/en-us/power-platform/admin/admin-settings for more details.
7+
---
8+
9+
# powerplatform_environment_settings (Data Source)
10+
11+
Power Platform Environment Settings Data Source. Power Platform Settings are configuration options that apply to a specific environment. They control various aspects of Power Platform features and behaviors, See [Environment Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/admin-settings) for more details.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `environment_id` (String) Unique environment id (guid)
21+
22+
### Optional
23+
24+
- `audit_and_logs` (Attributes) Audit and Logs (see [below for nested schema](#nestedatt--audit_and_logs))
25+
- `email` (Attributes) Email (see [below for nested schema](#nestedatt--email))
26+
- `product` (Attributes) Product (see [below for nested schema](#nestedatt--product))
27+
28+
### Read-Only
29+
30+
- `id` (String) Id
31+
32+
<a id="nestedatt--audit_and_logs"></a>
33+
### Nested Schema for `audit_and_logs`
34+
35+
Optional:
36+
37+
- `audit_settings` (Attributes) Audit Settings. See [Audit Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/system-settings-dialog-box-auditing-tab) for more details. (see [below for nested schema](#nestedatt--audit_and_logs--audit_settings))
38+
- `plugin_trace_log_setting` (String) Plugin trace log setting. Available options: Off, Exception, All. See [Plugin Trace Log Settings Overview](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/logging-tracing) for more details.
39+
40+
<a id="nestedatt--audit_and_logs--audit_settings"></a>
41+
### Nested Schema for `audit_and_logs.audit_settings`
42+
43+
Optional:
44+
45+
- `is_audit_enabled` (Boolean) Is audit enabled
46+
- `is_read_audit_enabled` (Boolean) Is read audit enabled
47+
- `is_user_access_audit_enabled` (Boolean) Is user access audit enabled
48+
49+
50+
51+
<a id="nestedatt--email"></a>
52+
### Nested Schema for `email`
53+
54+
Optional:
55+
56+
- `email_settings` (Attributes) Email Settings. See [Email Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/settings-email) for more details. (see [below for nested schema](#nestedatt--email--email_settings))
57+
58+
<a id="nestedatt--email--email_settings"></a>
59+
### Nested Schema for `email.email_settings`
60+
61+
Optional:
62+
63+
- `max_upload_file_size_in_bytes` (Number) Maximum file size that can be uploaded to the environment
64+
65+
66+
67+
<a id="nestedatt--product"></a>
68+
### Nested Schema for `product`
69+
70+
Optional:
71+
72+
- `behavior_settings` (Attributes) Behavior Settings.See [Behavior Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/settings-behavior) for more details. (see [below for nested schema](#nestedatt--product--behavior_settings))
73+
- `features` (Attributes) Features. See [Features Overview](https://learn.microsoft.com/en-us/power-platform/admin/settings-features) for more details. (see [below for nested schema](#nestedatt--product--features))
74+
75+
<a id="nestedatt--product--behavior_settings"></a>
76+
### Nested Schema for `product.behavior_settings`
77+
78+
Optional:
79+
80+
- `show_dashboard_cards_in_expanded_state` (Boolean) Show dashboard cards in expanded state
81+
82+
83+
<a id="nestedatt--product--features"></a>
84+
### Nested Schema for `product.features`
85+
86+
Optional:
87+
88+
- `power_apps_component_framework_for_canvas_apps` (Boolean) Power Apps component framework for canvas apps
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "powerplatform_tenant_application_packages Data Source - powerplatform"
4+
subcategory: ""
5+
description: |-
6+
Fetches the list of Dynamics 365 tenant level applications
7+
---
8+
9+
# powerplatform_tenant_application_packages (Data Source)
10+
11+
Fetches the list of Dynamics 365 tenant level applications
12+
13+
## Example Usage
14+
15+
```terraform
16+
terraform {
17+
required_providers {
18+
powerplatform = {
19+
source = "microsoft/power-platform"
20+
}
21+
}
22+
}
23+
24+
provider "powerplatform" {
25+
use_cli = true
26+
}
27+
28+
data "powerplatform_tenant_application_packages" "all_applications" {
29+
}
30+
31+
data "powerplatform_tenant_application_packages" "all_applications_from_publisher" {
32+
publisher_name = "Microsoft Dynamics SMB"
33+
}
34+
35+
data "powerplatform_tenant_application_packages" "specific_application" {
36+
name = "Healthcare Home Health"
37+
}
38+
```
39+
40+
<!-- schema generated by tfplugindocs -->
41+
## Schema
42+
43+
### Optional
44+
45+
- `id` (String) Id of the read operation
46+
- `name` (String) Name of the Dynamics 365 application
47+
- `publisher_name` (String) Publisher Name of the Dynamics 365 application
48+
49+
### Read-Only
50+
51+
- `applications` (Attributes List) List of Applications (see [below for nested schema](#nestedatt--applications))
52+
53+
<a id="nestedatt--applications"></a>
54+
### Nested Schema for `applications`
55+
56+
Read-Only:
57+
58+
- `application_descprition` (String) Applicaiton Description
59+
- `application_id` (String) ApplicaitonId
60+
- `application_name` (String) Name
61+
- `application_visibility` (String) Application Visibility
62+
- `catalog_visibility` (String) Catalog Visibility
63+
- `last_error` (Attributes List) Last Error (see [below for nested schema](#nestedatt--applications--last_error))
64+
- `learn_more_url` (String) Learn More Url
65+
- `localized_description` (String) Localized Description
66+
- `localized_name` (String) Localized Name
67+
- `publisher_id` (String) Publisher Id
68+
- `publisher_name` (String) Publisher Name
69+
- `unique_name` (String) Unique Name
70+
71+
<a id="nestedatt--applications--last_error"></a>
72+
### Nested Schema for `applications.last_error`
73+
74+
Read-Only:
75+
76+
- `error_code` (String) Error Code
77+
- `error_name` (String) Error Name
78+
- `message` (String) Message
79+
- `source` (String) Source
80+
- `status_code` (Number) Status Code
81+
- `type` (String) Type
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "powerplatform_environment_settings Resource - powerplatform"
4+
subcategory: ""
5+
description: |-
6+
Manages Power Platform Settings for a given environment. They control various aspects of Power Platform features and behaviors, See Environment Settings Overview https://learn.microsoft.com/en-us/power-platform/admin/admin-settings for more details.
7+
---
8+
9+
# powerplatform_environment_settings (Resource)
10+
11+
Manages Power Platform Settings for a given environment. They control various aspects of Power Platform features and behaviors, See [Environment Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/admin-settings) for more details.
12+
13+
## Example Usage
14+
15+
```terraform
16+
terraform {
17+
required_providers {
18+
powerplatform = {
19+
source = "microsoft/power-platform"
20+
}
21+
}
22+
}
23+
24+
provider "powerplatform" {
25+
use_cli = true
26+
}
27+
28+
resource "powerplatform_environment" "example_environment_settings" {
29+
display_name = "example_environment_settings"
30+
location = "europe"
31+
language_code = "1033"
32+
currency_code = "USD"
33+
environment_type = "Sandbox"
34+
security_group_id = "00000000-0000-0000-0000-000000000000"
35+
}
36+
37+
resource "powerplatform_environment_settings" "settings" {
38+
environment_id = powerplatform_environment.example_environment_settings.id
39+
40+
audit_and_logs = {
41+
plugin_trace_log_setting = "Exception"
42+
audit_settings = {
43+
is_audit_enabled = true
44+
is_user_access_audit_enabled = true
45+
is_read_audit_enabled = true
46+
}
47+
}
48+
email = {
49+
email_settings = {
50+
max_upload_file_size_in_bytes = 123456
51+
}
52+
}
53+
product = {
54+
behavior_settings = {
55+
show_dashboard_cards_in_expanded_state = true
56+
}
57+
features = {
58+
power_apps_component_framework_for_canvas_apps = false
59+
}
60+
}
61+
}
62+
```
63+
64+
<!-- schema generated by tfplugindocs -->
65+
## Schema
66+
67+
### Required
68+
69+
- `environment_id` (String) Environment Id
70+
71+
### Optional
72+
73+
- `audit_and_logs` (Attributes) Audit and Logs (see [below for nested schema](#nestedatt--audit_and_logs))
74+
- `email` (Attributes) Email (see [below for nested schema](#nestedatt--email))
75+
- `product` (Attributes) Product (see [below for nested schema](#nestedatt--product))
76+
77+
### Read-Only
78+
79+
- `id` (String) Id
80+
81+
<a id="nestedatt--audit_and_logs"></a>
82+
### Nested Schema for `audit_and_logs`
83+
84+
Optional:
85+
86+
- `audit_settings` (Attributes) Audit Settings. See [Audit Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/system-settings-dialog-box-auditing-tab) for more details. (see [below for nested schema](#nestedatt--audit_and_logs--audit_settings))
87+
- `plugin_trace_log_setting` (String) Plugin trace log setting. Available options: Off, Exception, All. See [Plugin Trace Log Settings Overview](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/logging-tracing) for more details.
88+
89+
<a id="nestedatt--audit_and_logs--audit_settings"></a>
90+
### Nested Schema for `audit_and_logs.audit_settings`
91+
92+
Optional:
93+
94+
- `is_audit_enabled` (Boolean) Is audit enabled
95+
- `is_read_audit_enabled` (Boolean) Is read audit enabled
96+
- `is_user_access_audit_enabled` (Boolean) Is user access audit enabled
97+
98+
99+
100+
<a id="nestedatt--email"></a>
101+
### Nested Schema for `email`
102+
103+
Optional:
104+
105+
- `email_settings` (Attributes) Email Settings. See [Email Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/settings-email) for more details. (see [below for nested schema](#nestedatt--email--email_settings))
106+
107+
<a id="nestedatt--email--email_settings"></a>
108+
### Nested Schema for `email.email_settings`
109+
110+
Optional:
111+
112+
- `max_upload_file_size_in_bytes` (Number) Maximum file size that can be uploaded to the environment
113+
114+
115+
116+
<a id="nestedatt--product"></a>
117+
### Nested Schema for `product`
118+
119+
Optional:
120+
121+
- `behavior_settings` (Attributes) Behavior Settings.See [Behavior Settings Overview](https://learn.microsoft.com/en-us/power-platform/admin/settings-behavior) for more details. (see [below for nested schema](#nestedatt--product--behavior_settings))
122+
- `features` (Attributes) Features. See [Features Overview](https://learn.microsoft.com/en-us/power-platform/admin/settings-features) for more details. (see [below for nested schema](#nestedatt--product--features))
123+
124+
<a id="nestedatt--product--behavior_settings"></a>
125+
### Nested Schema for `product.behavior_settings`
126+
127+
Optional:
128+
129+
- `show_dashboard_cards_in_expanded_state` (Boolean) Show dashboard cards in expanded state
130+
131+
132+
<a id="nestedatt--product--features"></a>
133+
### Nested Schema for `product.features`
134+
135+
Optional:
136+
137+
- `power_apps_component_framework_for_canvas_apps` (Boolean) Power Apps component framework for canvas apps

docs/resources/user.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
page_title: "powerplatform_user Resource - powerplatform"
44
subcategory: ""
55
description: |-
6-
This resource associates a user to a Power Platform environment.
7-
Additional Resources:\n\n
8-
\n\n * Add users to an environment https://learn.microsoft.com/en-us/power-platform/admin/add-users-to-environment"
9-
\n\n * Overview of User Security https://learn.microsoft.com/en-us/power-platform/admin/grant-users-access
6+
This resource associates a user to a Power Platform environment. Additional Resources:
7+
Add users to an environment https://learn.microsoft.com/en-us/power-platform/admin/add-users-to-environmentOverview of User Security https://learn.microsoft.com/en-us/power-platform/admin/grant-users-access
108
---
119

1210
# powerplatform_user (Resource)
1311

14-
This resource associates a user to a Power Platform environment.
15-
Additional Resources:\n\n
16-
\n\n * [Add users to an environment](https://learn.microsoft.com/en-us/power-platform/admin/add-users-to-environment)"
17-
\n\n * [Overview of User Security](https://learn.microsoft.com/en-us/power-platform/admin/grant-users-access)
12+
This resource associates a user to a Power Platform environment. Additional Resources:
13+
14+
* [Add users to an environment](https://learn.microsoft.com/en-us/power-platform/admin/add-users-to-environment)
15+
16+
* [Overview of User Security](https://learn.microsoft.com/en-us/power-platform/admin/grant-users-access)
1817

1918
## Example Usage
2019

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
terraform {
2+
required_providers {
3+
powerplatform = {
4+
source = "microsoft/power-platform"
5+
}
6+
}
7+
}
8+
9+
provider "powerplatform" {
10+
use_cli = true
11+
}
12+
13+
resource "powerplatform_environment" "example_environment_settings" {
14+
display_name = "example_environment_settings"
15+
location = "europe"
16+
language_code = "1033"
17+
currency_code = "USD"
18+
environment_type = "Sandbox"
19+
security_group_id = "00000000-0000-0000-0000-000000000000"
20+
}
21+
22+
data "powerplatform_environment_settings" "settings" {
23+
environment_id = powerplatform_environment.example_environment_settings.id
24+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "all_settings" {
2+
description = "Environment settings for a chosen environment."
3+
value = data.powerplatform_environment_settings.settings
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "all_settings" {
2+
description = "Environment settings for the Power Platform environment"
3+
value = powerplatform_environment_settings.settings
4+
}

0 commit comments

Comments
 (0)