azurermMaintenanceConfiguration
Manages a maintenance configuration.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermMaintenanceConfigurationExample =
new azurerm.maintenanceConfiguration.MaintenanceConfiguration(
this,
"example_2",
{
location: azurermResourceGroupExample.location,
name: "example-mc",
resource_group_name: azurermResourceGroupExample.name,
scope: "SQLDB",
tags: {
Env: "prod",
},
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMaintenanceConfigurationExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the Maintenance Configuration. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the Resource Group where the Maintenance Configuration should exist. Changing this forces a new resource to be created. -
location
- (Required) Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created. -
scope
- (Required) The scope of the Maintenance Configuration. Possible values areextension
,host
,inGuestPatch
,osImage
,sqldb
orsqlManagedInstance
. -
visibility
- (Optional) The visibility of the Maintenance Configuration. The only allowable value iscustom
. -
window
- (Optional) Awindow
block as defined below. -
installPatches
- (Optional) AninstallPatches
block as defined below.
-> NOTE: installPatches
must be specified when scope
is inGuestPatch
.
-
inGuestUserPatchMode
- (Optional) The in guest user patch mode. Possible values areplatform
oruser
. Must be specified whenscope
isinGuestPatch
. -
properties
- (Optional) A mapping of properties to assign to the resource. -
tags
- (Optional) A mapping of tags to assign to the resource. The key could not contain upper case letter.
A window
block supports:
-
startDateTime
- (Required) Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. -
expirationDateTime
- (Optional) Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. -
duration
- (Optional) The duration of the maintenance window in HH:mm format. -
timeZone
- (Required) The time zone for the maintenance window. A list of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. -
recurEvery
- (Optional) The rate at which a maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules.
A installPatches
block supports:
-
linux
- (Optional) Alinux
block as defined above. This property only applies whenscope
is set toinGuestPatch
-
windows
- (Optional) Awindows
block as defined above. This property only applies whenscope
is set toinGuestPatch
-
reboot
- (Optional) Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed. Possible values arealways
,ifRequired
andnever
. This property only applies whenscope
is set toinGuestPatch
.
A linux
block supports:
-
classificationsToInclude
- (Optional) List of Classification category of patches to be patched. Possible values arecritical
,security
andother
. -
packageNamesMaskToExclude
- (Optional) List of package names to be excluded from patching. -
packageNamesMaskToInclude
- (Optional) List of package names to be included for patching.
A windows
block supports:
-
classificationsToInclude
- (Optional) List of Classification category of patches to be patched. Possible values arecritical
,security
,updateRollup
,featurePack
,servicePack
,definition
,tools
andupdates
. -
kbNumbersToExclude
- (Optional) List of KB numbers to be excluded from patching. -
kbNumbersToInclude
- (Optional) List of KB numbers to be included for patching.
Attributes Reference
The following attributes are exported:
id
- The ID of the Maintenance Configuration.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Maintenance Configuration.update
- (Defaults to 30 minutes) Used when updating the Maintenance Configuration.read
- (Defaults to 5 minutes) Used when retrieving the Maintenance Configuration.delete
- (Defaults to 30 minutes) Used when deleting the Maintenance Configuration.
Import
Maintenance Configuration can be imported using the resourceId
, e.g.