-
Notifications
You must be signed in to change notification settings - Fork 15
feat: extend powerplatform_enterprise_policy to include identity policy type and related resources #1022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mawasile
wants to merge
9
commits into
main
Choose a base branch
from
mawasile/917-extend-the-powerplatform_enterprise_policy-to-include-the-policy-type-identity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: extend powerplatform_enterprise_policy to include identity policy type and related resources #1022
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6c233a9
feat: extend powerplatform_enterprise_policy to include identity poli…
mawasile 07931c7
Merge branch 'main' into mawasile/917-extend-the-powerplatform_enterp…
mawasile 8f58df9
feat: extend powerplatform_enterprise_policy to support Identity poli…
mawasile b9e06a9
Merge branch 'mawasile/917-extend-the-powerplatform_enterprise_policy…
mawasile f138c83
Update examples/resources/powerplatform_enterprise_policy/resource.tf
mawasile bcd52c9
Update examples/resources/powerplatform_enterprise_policy/identity/ma…
mawasile c8ec47a
feat: add identity policy module and update resource configurations
mawasile 1190089
Merge branch 'mawasile/917-extend-the-powerplatform_enterprise_policy…
mawasile 76f782a
fix: correct dependency reference for encryption policy module
mawasile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| kind: changed | ||
| body: Extended powerplatform_enterprise_policy resource to support Identity policy type | ||
| time: 2025-12-23T14:53:59.263648543Z | ||
| custom: | ||
| Issue: "917" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
examples/resources/powerplatform_enterprise_policy/encryption/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
examples/resources/powerplatform_enterprise_policy/identity/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| terraform { | ||
| required_version = "> 1.7.0" | ||
| required_providers { | ||
| powerplatform = { | ||
| source = "microsoft/power-platform" | ||
| version = "~>4.0" | ||
| } | ||
| azapi = { | ||
| source = "azure/azapi" | ||
| version = "~>2.0" | ||
| } | ||
| azurerm = { | ||
| source = "hashicorp/azurerm" | ||
| version = "~>4.8" | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| variable "environment_id" { | ||
| description = "The ID of the environment" | ||
| type = string | ||
| validation { | ||
| condition = length(var.environment_id) > 0 | ||
| error_message = "The environment ID must not be empty" | ||
| } | ||
| } | ||
|
|
||
| variable "should_register_provider" { | ||
| description = "A flag to determine if the PowerPlatform provider should be registered in the subscription" | ||
| type = bool | ||
| default = true | ||
| } | ||
|
|
||
| variable "resource_group_name" { | ||
| description = "The name of the resource group" | ||
| type = string | ||
| validation { | ||
| condition = length(var.resource_group_name) > 0 | ||
| error_message = "The resource group name must not be empty" | ||
| } | ||
| } | ||
|
|
||
| variable "resource_group_location" { | ||
| description = "The location of the resource group" | ||
| type = string | ||
| validation { | ||
| condition = length(var.resource_group_location) > 0 | ||
| error_message = "The resource group location must not be empty" | ||
| } | ||
| } | ||
|
|
||
| variable "enterprise_policy_name" { | ||
| description = "The name of the enterprise policy" | ||
| type = string | ||
| validation { | ||
| condition = length(var.enterprise_policy_name) > 0 | ||
| error_message = "The enterprise policy name must not be empty" | ||
| } | ||
| } | ||
|
|
||
| variable "enterprise_policy_location" { | ||
| description = "The location of the enterprise policy" | ||
| type = string | ||
| validation { | ||
| condition = length(var.enterprise_policy_location) > 0 | ||
| error_message = "The enterprise policy location must not be empty" | ||
| } | ||
| } | ||
|
|
||
| variable "policy_reader_object_id" { | ||
| description = "The object ID of the user to assign the Reader role to (needed to finish the setup of the Azure Synapse Link to Dataverse)" | ||
| type = string | ||
| validation { | ||
| condition = length(var.policy_reader_object_id) > 0 | ||
| error_message = "The policy reader object ID must not be empty" | ||
| } | ||
| } | ||
|
|
||
| resource "azurerm_resource_group" "resource_group" { | ||
| name = var.resource_group_name | ||
| location = var.resource_group_location | ||
| } | ||
|
|
||
| resource "azurerm_resource_provider_registration" "provider_registration" { | ||
| count = var.should_register_provider ? 1 : 0 | ||
| name = "Microsoft.PowerPlatform" | ||
| } | ||
|
|
||
| resource "azurerm_role_assignment" "policy_reader" { | ||
| scope = azapi_resource.powerplatform_policy.id | ||
| role_definition_name = "Reader" | ||
| principal_id = var.policy_reader_object_id | ||
| } | ||
|
|
||
| resource "azapi_resource" "powerplatform_policy" { | ||
| schema_validation_enabled = false | ||
|
|
||
| type = "Microsoft.PowerPlatform/enterprisePolicies@2020-10-30-preview" | ||
| name = var.enterprise_policy_name | ||
| location = var.enterprise_policy_location | ||
| parent_id = azurerm_resource_group.resource_group.id | ||
| body = { | ||
| identity = { | ||
| type = "SystemAssigned" | ||
| } | ||
| kind = "Identity" | ||
| } | ||
| } | ||
|
|
||
| resource "powerplatform_enterprise_policy" "identity_policy" { | ||
| environment_id = var.environment_id | ||
| system_id = azapi_resource.powerplatform_policy.output.properties.systemId | ||
| policy_type = "Identity" | ||
| } | ||
|
|
||
| output "enterprise_policy_system_id" { | ||
| value = azapi_resource.powerplatform_policy.output.properties.systemId | ||
| } | ||
|
|
||
| output "enterprise_policy_id" { | ||
| value = azapi_resource.powerplatform_policy.output.id | ||
| } | ||
|
|
8 changes: 6 additions & 2 deletions
8
examples/resources/powerplatform_enterprise_policy/network_injection/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.