Skip to content

Commit

Permalink
Delete Lock for Log Analytics Workspace resource group (Azure#205)
Browse files Browse the repository at this point in the history
Add delete lock for LAW RG
  • Loading branch information
SenthuranSivananthan committed Mar 5, 2022
1 parent 678355f commit 81eccd1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions landingzones/lz-platform-logging/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ param logAnalyticsAutomationAccountName string
@description('Log Analytics Workspace Data Retention in days.')
param logAnalyticsRetentionInDays int

@description('Flag to determine whether delete lock should be created on resource group(s). Default: true')
param enableDeleteLockOnResourceGroup bool = true

// Telemetry - Azure customer usage attribution
// Reference: https://docs.microsoft.com/azure/marketplace/azure-partner-customer-usage-attribution
var telemetry = json(loadTextContent('../../config/telemetry.json'))
Expand All @@ -201,6 +204,12 @@ resource rgLogging 'Microsoft.Resources/resourceGroups@2020-06-01' = {
tags: resourceTags
}

// Delete lock on resource group
module rgLoggingDeleteLock '../../azresources/util/delete-lock.bicep' = if (enableDeleteLockOnResourceGroup) {
name: 'deploy-delete-lock-${rgLogging.name}'
scope: rgLogging
}

// Create Log Analytics Workspace
module logAnalytics '../../azresources/monitor/log-analytics.bicep' = {
name: logAnalyticsWorkspaceName
Expand Down

0 comments on commit 81eccd1

Please sign in to comment.