Skip to content

Commit

Permalink
move default values
Browse files Browse the repository at this point in the history
  • Loading branch information
rahalan committed Dec 20, 2024
1 parent e4ed064 commit ea00133
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion avm/res/compute/virtual-machine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5375,7 +5375,7 @@ The configuration for the [Anti Malware] extension. Must at least contain the ["

- Required: No
- Type: object
- Default: `[if(equals(parameters('osType'), 'Windows'), createObject('enabled', true(), 'settings', createObject('AntimalwareEnabled', 'true', 'Exclusions', createObject(), 'RealtimeProtectionEnabled', 'true', 'ScheduledScanSettings', createObject('day', '7', 'isEnabled', 'true', 'scanType', 'Quick', 'time', '120'))), createObject('enabled', false()))]`
- Default: `[if(equals(parameters('osType'), 'Windows'), createObject('enabled', true()), createObject('enabled', false()))]`

### Parameter: `extensionAzureDiskEncryptionConfig`

Expand Down
23 changes: 11 additions & 12 deletions avm/res/compute/virtual-machine/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,6 @@ param extensionAadJoinConfig object = {
param extensionAntiMalwareConfig object = osType == 'Windows'
? {
enabled: true
settings: {
AntimalwareEnabled: 'true'
Exclusions: {}
RealtimeProtectionEnabled: 'true'
ScheduledScanSettings: {
day: '7'
isEnabled: 'true'
scanType: 'Quick'
time: '120'
}
}
}
: { enabled: false }

Expand Down Expand Up @@ -755,7 +744,17 @@ module vm_microsoftAntiMalwareExtension 'extension/main.bicep' = if (extensionAn
typeHandlerVersion: extensionAntiMalwareConfig.?typeHandlerVersion ?? '1.3'
autoUpgradeMinorVersion: extensionAntiMalwareConfig.?autoUpgradeMinorVersion ?? true
enableAutomaticUpgrade: extensionAntiMalwareConfig.?enableAutomaticUpgrade ?? false
settings: extensionAntiMalwareConfig.settings
settings: extensionAntiMalwareConfig.?settings ?? {
AntimalwareEnabled: 'true'
Exclusions: {}
RealtimeProtectionEnabled: 'true'
ScheduledScanSettings: {
day: '7'
isEnabled: 'true'
scanType: 'Quick'
time: '120'
}
}
supressFailures: extensionAntiMalwareConfig.?supressFailures ?? false
tags: extensionAntiMalwareConfig.?tags ?? tags
}
Expand Down
6 changes: 3 additions & 3 deletions avm/res/compute/virtual-machine/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "17689937671944537269"
"templateHash": "18035592397318794838"
},
"name": "Virtual Machines",
"description": "This module deploys a Virtual Machine with one or multiple NICs and optionally one or multiple public IPs.",
Expand Down Expand Up @@ -648,7 +648,7 @@
},
"extensionAntiMalwareConfig": {
"type": "object",
"defaultValue": "[if(equals(parameters('osType'), 'Windows'), createObject('enabled', true(), 'settings', createObject('AntimalwareEnabled', 'true', 'Exclusions', createObject(), 'RealtimeProtectionEnabled', 'true', 'ScheduledScanSettings', createObject('day', '7', 'isEnabled', 'true', 'scanType', 'Quick', 'time', '120'))), createObject('enabled', false()))]",
"defaultValue": "[if(equals(parameters('osType'), 'Windows'), createObject('enabled', true()), createObject('enabled', false()))]",
"metadata": {
"description": "Optional. The configuration for the [Anti Malware] extension. Must at least contain the [\"enabled\": true] property to be executed."
}
Expand Down Expand Up @@ -3310,7 +3310,7 @@
"value": "[coalesce(tryGet(parameters('extensionAntiMalwareConfig'), 'enableAutomaticUpgrade'), false())]"
},
"settings": {
"value": "[parameters('extensionAntiMalwareConfig').settings]"
"value": "[coalesce(tryGet(parameters('extensionAntiMalwareConfig'), 'settings'), createObject('AntimalwareEnabled', 'true', 'Exclusions', createObject(), 'RealtimeProtectionEnabled', 'true', 'ScheduledScanSettings', createObject('day', '7', 'isEnabled', 'true', 'scanType', 'Quick', 'time', '120')))]"
},
"supressFailures": {
"value": "[coalesce(tryGet(parameters('extensionAntiMalwareConfig'), 'supressFailures'), false())]"
Expand Down

0 comments on commit ea00133

Please sign in to comment.