Skip to content

refactor: Separation of policy assignments module to avoid hitting ARM size limit and include workload specific policy assignments #975

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

Merged
merged 5 commits into from
Mar 12, 2025

Conversation

oZakari
Copy link
Contributor

@oZakari oZakari commented Mar 7, 2025

Overview/Summary

As part of the PR, I have created a new module called workloadSpecificPolicyAssignments.bicep which is used to assign all of the policies here. Although assigned, they are set to DoNotEnforce which equates to putting them in audit mode.

I have also refactored the alzDefaultPolicyAssignments.bicep file to remove the Sovereign Landing Zone policy assignments and exemptions (and associated parameters) which have now been moved to the workloadSpecificPolicyAssignments.bicep. This change implemented to reduce the size of the compiled deployment in relation to this issue.

Related Issues/Work Items

Fixed AB#202503

This PR fixes/adds/changes/removes

Configuration Updates:

  • Added a new workload-specific policy assignment to the accelerator/.config/ALZ-Powershell-Auto.config.json file. This includes specifying the template and parameter file paths, management group ID, deployment type, and order.
  • Adjusted the order of existing policy assignments to accommodate the new workload-specific policy assignment. [1] [2] [3] [4] [5] [6]

Documentation Updates:

  • Updated the AssigningPolicies.md file to include the new workload-specific policy assignments module and removed the pre-requisites section. [1] [2]
  • Updated the DeploymentFlow.md file to include the new workload-specific policy assignments module in the deployment order. [1] [2]

Codebase Simplification:

  • Removed the policyAssignmentSovereigntyGlobalOptionsType and policyAssignmentSovereigntyConfidentialOptionsType types from the alzDefaultPolicyAssignments.bicep file.

Breaking Changes

  1. This PR introduces breaking changes with the alzDefaultPolicyAssignments.bicep module as we have removed the following parameters associated to Sovereign Landing Zones. These associated policy assignments and exemptions have been moved to the workloadSpecificPolicyAssignments.bicep module.

    • parTopLevelPolicyAssignmentSovereigntyGlobal
    • parPolicyAssignmentSovereigntyConfidential
    • parAllowedVirtualMachineSKUs

Testing Evidence

Replace this with any testing evidence to show that your Pull Request works/fixes as described and planned (include screenshots, if appropriate).

As part of this Pull Request I have

@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 7, 2025 18:28 — with GitHub Actions Failure
@oZakari oZakari changed the title Initial start to refactor of policy assignments module refactor: Separation of policy assignments module to avoid hitting ARM size limit and include workload specific policy assignments Mar 7, 2025
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 7, 2025 18:29 — with GitHub Actions Failure
@oZakari oZakari marked this pull request as draft March 7, 2025 18:30
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:11 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Failure
@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 12, 2025 01:20 — with GitHub Actions Inactive
@oZakari oZakari closed this Mar 12, 2025
@oZakari oZakari reopened this Mar 12, 2025
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:28 — with GitHub Actions Failure
@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 12, 2025 01:44 — with GitHub Actions Inactive
@oZakari oZakari added the Type: Enhancement ✨ New feature or request label Mar 12, 2025
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 12, 2025 01:52 — with GitHub Actions Failure
@oZakari oZakari requested a review from Copilot March 12, 2025 01:52
@oZakari oZakari marked this pull request as ready for review March 12, 2025 01:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the policy assignments module to separate workload-specific policy assignments, addressing ARM template size limitations while streamlining the documentation and codebase.

  • Added documentation for the new workload-specific policy assignments module.
  • Adjusted the order and descriptions in both policy assignments and deployment documentation.
  • Removed deprecated types from the policy assignments Bicep file.

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated no comments.

File Description
docs/wiki/AssigningPolicies.md Updated to reference the new workload-specific module and adjusted the instructions for policy assignment exclusion.
infra-as-code/bicep/modules/policy/assignments/alzDefaults/generateddocs/alzDefaultPolicyAssignments.bicep.md Revised parameter documentation to reflect changes in policy enforcement and removed deprecated parameters.
docs/wiki/AddingPolicyDefs.md Removed the pre-requisites section to streamline the procedure for adding custom policy definitions.
docs/wiki/DeploymentFlow.md Updated the module deployment order and added the workload-specific policy assignments row.

@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 12, 2025 02:02 — with GitHub Actions Inactive
@oZakari oZakari added the Area: Policy 📝 Issues / PR's related to Policy label Mar 12, 2025
@oZakari oZakari merged commit 0c63ca5 into main Mar 12, 2025
17 of 18 checks passed
@oZakari oZakari deleted the policy-assignment-module-refactor branch March 12, 2025 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Policy 📝 Issues / PR's related to Policy Type: Enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant