azurermMonitorActionRuleSuppression
Manages an Monitor Action Rule which type is suppression.
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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermMonitorActionRuleSuppressionExample =
new azurerm.monitorActionRuleSuppression.MonitorActionRuleSuppression(
this,
"example_1",
{
name: "example-amar",
resource_group_name: azurermResourceGroupExample.name,
scope: [
{
resource_ids: [azurermResourceGroupExample.id],
type: "ResourceGroup",
},
],
suppression: [
{
recurrence_type: "Weekly",
schedule: [
{
end_date_utc: "2019-01-03T15:02:07Z",
recurrence_weekly: ["Sunday", "Monday", "Friday", "Saturday"],
start_date_utc: "2019-01-01T01:02:03Z",
},
],
},
],
tags: {
foo: "bar",
},
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMonitorActionRuleSuppressionExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the Monitor Action Rule. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) Specifies the name of the resource group in which the Monitor Action Rule should exist. Changing this forces a new resource to be created. -
suppression
- (Required) Asuppression
block as defined below. -
description
- (Optional) Specifies a description for the Action Rule. -
enabled
- (Optional) Is the Action Rule enabled? Defaults totrue
. -
scope
- (Optional) Ascope
block as defined below. -
condition
- (Optional) Acondition
block as defined below. -
tags
- (Optional) A mapping of tags to assign to the resource.
The suppression
block supports the following:
-
recurrenceType
- (Required) Specifies the type of suppression. Possible values arealways
,daily
,monthly
,once
, andweekly
. -
schedule
- (Optional) Aschedule
block as defined below. Required ifrecurrenceType
isdaily
,monthly
,once
orweekly
.
The schedule
block supports the following:
-
startDateUtc
- (Required) specifies the recurrence UTC start datetime (Y-m-d'T'H:M:S'Z'). -
endDateUtc
- (Required) specifies the recurrence UTC end datetime (Y-m-d'T'H:M:S'Z'). -
recurrenceWeekly
- (Optional) specifies the list of dayOfWeek to recurrence. Possible values aresunday
,monday
,tuesday
,wednesday
,thursday
,friday
andsaturday
. -
recurrenceMonthly
- (Optional) specifies the list of dayOfMonth to recurrence. Possible values are between1
-31
. Required ifrecurrenceType
ismonthly
.
The scope
block supports the following:
-
type
- (Required) Specifies the type of target scope. Possible values areresourceGroup
andresource
. -
resourceIds
- (Required) A list of resource IDs of the given scope type which will be the target of action rule.
The condition
block supports the following:
-
alertContext
- (Optional) AalertContext
block as defined below. -
alertRuleId
- (Optional) AalertRuleId
block as defined below. -
description
- (Optional) Adescription
block as defined below. -
monitor
- (Optional) Amonitor
block as defined below. -
monitorService
- (Optional) AmonitorService
as block defined below. -
severity
- (Optional) Aseverity
block as defined below. -
targetResourceType
- (Optional) AtargetResourceType
block as defined below.
The alertContext
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
,notEquals
,contains
, anddoesNotContain
. -
values
- (Required) A list of values to match for a given condition.
The alertRuleId
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
,notEquals
,contains
, anddoesNotContain
. -
values
- (Required) A list of values to match for a given condition.
The description
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
,notEquals
,contains
, anddoesNotContain
. -
values
- (Required) A list of values to match for a given condition.
The monitor
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
andnotEquals
. -
values
- (Required) A list of values to match for a given condition. Possible values arefired
andresolved
.
The monitorService
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
andnotEquals
. -
values
- (Required) A list of values to match for a given condition. Possible values areactivityLogAdministrative
,activityLogAutoscale
,activityLogPolicy
,activityLogRecommendation
,activityLogSecurity
,applicationInsights
,azureBackup
,azureStackEdge
,azureStackHub
,custom
,dataBoxGateway
,healthPlatform
,logAlertsV2
,logAnalytics
,platform
,resourceHealth
,smartDetector
andvmInsightsHealth
.
The severity
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
andnotEquals
. -
values
- (Required) A list of values to match for a given condition. Possible values aresev0
,sev1
,sev2
,sev3
, andsev4
.
The targetResourceType
block supports the following:
-
operator
- (Required) The operator for a given condition. Possible values areequals
andnotEquals
. -
values
- (Required) A list of values to match for a given condition. The values should be valid resource types.
Attributes Reference
The following attributes are exported:
id
- The ID of the Monitor Action Rule.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Monitor Action Rule.read
- (Defaults to 5 minutes) Used when retrieving the Monitor Action Rule.update
- (Defaults to 30 minutes) Used when updating the Monitor Action Rule.delete
- (Defaults to 30 minutes) Used when deleting the Monitor Action Rule.
Import
Monitor Action Rule can be imported using the resourceId
, e.g.