Skip to content

Commit

Permalink
Fixed the AKS policy deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tredell committed Feb 11, 2023
1 parent f9e8418 commit c58ba48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions policy/custom/definitions/policyset/AKS.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
targetScope = 'managementGroup'

@description('Management Group scope for the policy definition.')
param policyDefinitionManagementGroupId string

var customPolicyDefinitionMgScope = tenantResourceId('Microsoft.Management/managementGroups', policyDefinitionManagementGroupId)

resource aksPolicySet 'Microsoft.Authorization/policySetDefinitions@2020-03-01' = {
name: 'custom-aks'
Expand All @@ -29,15 +26,15 @@ resource aksPolicySet 'Microsoft.Authorization/policySetDefinitions@2020-03-01'
groupNames: [
'AKS'
]
policyDefinitionId: extensionResourceId(customPolicyDefinitionMgScope, 'Microsoft.Authorization/policyDefinitions', 'a8eff44f-8c92-45c3-a3fb-9880802d67a7')
policyDefinitionId: tenantResourceId('Microsoft.Authorization/policyDefinitions', 'a8eff44f-8c92-45c3-a3fb-9880802d67a7')
policyDefinitionReferenceId: toLower(replace('Deploy Azure Policy Add-on to Azure Kubernetes Service clusters', ' ', '-'))
parameters: {}
}
{
groupNames: [
'AKS'
]
policyDefinitionId: extensionResourceId(customPolicyDefinitionMgScope, 'Microsoft.Authorization/policyDefinitions', '3fc4dc25-5baf-40d8-9b05-7fe74c1bc64e')
policyDefinitionId: tenantResourceId('Microsoft.Authorization/policyDefinitions', '3fc4dc25-5baf-40d8-9b05-7fe74c1bc64e')
policyDefinitionReferenceId: toLower(replace('Kubernetes clusters should use internal load balancers', ' ', '-'))
parameters: {}
}
Expand Down
4 changes: 1 addition & 3 deletions policy/custom/definitions/policyset/AKS.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"policyDefinitionManagementGroupId": {
"value": "{{var-topLevelManagementGroupName}}"
}

}
}

0 comments on commit c58ba48

Please sign in to comment.