Skip to content

Commit

Permalink
Added param and logic for category of resource logs
Browse files Browse the repository at this point in the history
  • Loading branch information
oZakari committed Oct 23, 2024
1 parent 5b8c82c commit e7e07d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ param parLogAnalyticsWorkSpaceAndAutomationAccountLocation string = 'eastus'
@description('Resource ID of Log Analytics Workspace.')
param parLogAnalyticsWorkspaceResourceId string = ''

@sys.description('Category of logs for supported resource logging for Log Analytics Workspace.')
param parLogAnalyticsWorkspaceResourceCategory string = 'allLogs'

@description('Resource ID for VM Insights Data Collection Rule.')
param parDataCollectionRuleVMInsightsResourceId string = ''

Expand Down Expand Up @@ -380,6 +383,7 @@ var varPolicyAssignmentDeployPrivateDNSZones = {

var varPolicyAssignmentDeployResourceDiag = {
definitionId: '/providers/Microsoft.Authorization/policySetDefinitions/0884adba-2312-4468-abeb-5422caed1038'
conditionalDefinitionId: '/providers/Microsoft.Authorization/policySetDefinitions/f5b29bc4-feca-4cc6-a58a-772dd5e290a5'
libDefinition: loadJsonContent('../../../policy/assignments/lib/policy_assignments/policy_assignment_es_deploy_resource_diag.tmpl.json')
}

Expand Down Expand Up @@ -740,7 +744,7 @@ module modPolicyAssignmentIntRootDeployResourceDiag '../../../policy/assignments
scope: managementGroup(varManagementGroupIds.intRoot)
name: varModuleDeploymentNames.modPolicyAssignmentIntRootDeployResourceDiag
params: {
parPolicyAssignmentDefinitionId: varPolicyAssignmentDeployResourceDiag.definitionId
parPolicyAssignmentDefinitionId: parLogAnalyticsWorkspaceResourceCategory =~ 'allLogs' ? varPolicyAssignmentDeployResourceDiag.definitionId : varPolicyAssignmentDeployResourceDiag.conditionalDefinitionId
parPolicyAssignmentName: varPolicyAssignmentDeployResourceDiag.libDefinition.name
parPolicyAssignmentDisplayName: varPolicyAssignmentDeployResourceDiag.libDefinition.properties.displayName
parPolicyAssignmentDescription: varPolicyAssignmentDeployResourceDiag.libDefinition.properties.description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parLandingZoneChildrenMgAlzDefaultsEnable | No | Assign policies to Corp &
parLandingZoneMgConfidentialEnable | No | Assign policies to Confidential Corp and Online groups under Landing Zones.
parLogAnalyticsWorkSpaceAndAutomationAccountLocation | No | Location of Log Analytics Workspace & Automation Account.
parLogAnalyticsWorkspaceResourceId | No | Resource ID of Log Analytics Workspace.
parLogAnalyticsWorkspaceResourceCategory | No | Category of logs for supported resource logging for Log Analytics Workspace.
parDataCollectionRuleVMInsightsResourceId | No | Resource ID for VM Insights Data Collection Rule.
parDataCollectionRuleChangeTrackingResourceId | No | Resource ID for Change Tracking Data Collection Rule.
parDataCollectionRuleMDFCSQLResourceId | No | Resource ID for MDFC SQL Data Collection Rule.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"parLogAnalyticsWorkspaceLogRetentionInDays": {
"value": "365"
},
"parLogAnalyticsWorkspaceResourceCategory": {
"value": "allLogs"
},
"parDataCollectionRuleVMInsightsResourceId": {
"value": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/alz-logging/providers/Microsoft.Insights/dataCollectionRules/alz-ama-vmi-dcr"
},
Expand Down

0 comments on commit e7e07d2

Please sign in to comment.