Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
oZakari committed Dec 18, 2024
1 parent 9bc3151 commit 6bbf552
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ metadata description = 'This module deploys a Policy Exemption at a Management G
// Parameters //
// ========== //

@description('Required. The policy definition ID to assign the policy to.')
param policyDefinitionID string = '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d'

@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.')
param serviceShort string = 'apemgmin'

Expand All @@ -22,14 +19,19 @@ param resourceLocation string = deployment().location
// Test Execution //
// ============== //

resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' existing = {
name: '06a78e20-9358-41c9-923c-fb736d382a4d'
scope: tenant()
}

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: 'audit-vm-managed-disks'
scope: managementGroup()
properties: {
metadata: {
assignedBy: 'Bicep'
}
policyDefinitionId: policyDefinitionID
policyDefinitionId: policyDefinition.id
description: ' This policy audits VMs that do not use managed disks'
displayName: 'Audit VMs that do not use managed disks'
enforcementMode: 'DoNotEnforce'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ param serviceShort string = 'apemgmax'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Required. The policy definition ID to assign the policy to.')
param policyDefinitionID string = '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d'

@description('Optional. The location to deploy resources to.')
param resourceLocation string = deployment().location

// ============== //
// Test Execution //
// ============== //

resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' existing = {
name: '06a78e20-9358-41c9-923c-fb736d382a4d'
scope: tenant()
}

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: 'audit-vm-managed-disks'
scope: managementGroup()
properties: {
metadata: {
assignedBy: 'Bicep'
}
policyDefinitionId: policyDefinitionID
policyDefinitionId: policyDefinition.id
description: ' This policy audits VMs that do not use managed disks'
displayName: 'Audit VMs that do not use managed disks'
enforcementMode: 'DoNotEnforce'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ param serviceShort string = 'apergmin'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Optional. The policy definition ID to assign the policy to.')
param policyDefinitionID string = '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d'

@description('Optional. The target scope for the policy exemption. If not provided, will use the current scope for deployment.')
param subscriptionId string = '#_subscriptionId_#'

Expand All @@ -38,6 +35,10 @@ module resourceGroup 'br/public:avm/res/resources/resource-group:0.2.3' = {
}
}

resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' existing = {
name: '06a78e20-9358-41c9-923c-fb736d382a4d'
scope: tenant()
}

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: 'audit-vm-managed-disks'
Expand All @@ -46,7 +47,7 @@ resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01'
metadata: {
assignedBy: 'Bicep'
}
policyDefinitionId: policyDefinitionID
policyDefinitionId: policyDefinition.id
description: ' This policy audits VMs that do not use managed disks'
displayName: 'Audit VMs that do not use managed disks'
enforcementMode: 'DoNotEnforce'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ param serviceShort string = 'apergmax'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Optional. The policy definition ID to assign the policy to.')
param policyDefinitionID string = '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d'

@description('Optional. The target scope for the policy exemption. If not provided, will use the current scope for deployment.')
param subscriptionId string = '#_subscriptionId_#'

Expand All @@ -37,14 +34,19 @@ module resourceGroup 'br/public:avm/res/resources/resource-group:0.2.3' = {
}
}

resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' existing = {
name: '06a78e20-9358-41c9-923c-fb736d382a4d'
scope: tenant()
}

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: 'audit-vm-managed-disks'
scope: managementGroup()
properties: {
metadata: {
assignedBy: 'Bicep'
}
policyDefinitionId: policyDefinitionID
policyDefinitionId: policyDefinition.id
description: ' This policy audits VMs that do not use managed disks'
displayName: 'Audit VMs that do not use managed disks'
enforcementMode: 'DoNotEnforce'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ param serviceShort string = 'apesubmin'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Optional. The policy definition ID to assign the policy to.')
param policyDefinitionID string = '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d'

@description('Optional. The target Scope for the policy exemption. If not provided, will use the current scope for deployment.')
param subscriptionId string = '#_subscriptionId_#'

Expand All @@ -25,14 +22,19 @@ param resourceLocation string = deployment().location
// Test Execution //
// ============== //

resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' existing = {
name: '06a78e20-9358-41c9-923c-fb736d382a4d'
scope: tenant()
}

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: 'audit-vm-managed-disks'
scope: managementGroup()
properties: {
metadata: {
assignedBy: 'Bicep'
}
policyDefinitionId: policyDefinitionID
policyDefinitionId: policyDefinition.id
description: ' This policy audits VMs that do not use managed disks'
displayName: 'Audit VMs that do not use managed disks'
enforcementMode: 'DoNotEnforce'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ param serviceShort string = 'apesubmax'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

@description('Optional. The policy definition ID to assign the policy to.')
param policyDefinitionID string = '/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d'

@description('Optional. The target Scope for the policy exemption. If not provided, will use the current scope for deployment.')
param subscriptionId string = '#_subscriptionId_#'

Expand All @@ -25,14 +22,19 @@ param resourceLocation string = deployment().location
// Test Execution //
// ============== //

resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' existing = {
name: '06a78e20-9358-41c9-923c-fb736d382a4d'
scope: tenant()
}

resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
name: 'audit-vm-managed-disks'
scope: managementGroup()
properties: {
metadata: {
assignedBy: 'Bicep'
}
policyDefinitionId: policyDefinitionID
policyDefinitionId: policyDefinition.id
description: ' This policy audits VMs that do not use managed disks'
displayName: 'Audit VMs that do not use managed disks'
enforcementMode: 'DoNotEnforce'
Expand Down

0 comments on commit 6bbf552

Please sign in to comment.