azurermMonitorActionRuleActionGroup
Manages an Monitor Action Rule which type is action group.
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 azurermMonitorActionGroupExample =
new azurerm.monitorActionGroup.MonitorActionGroup(this, "example_1", {
name: "example-action-group",
resource_group_name: azurermResourceGroupExample.name,
short_name: "example",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermMonitorActionGroupExample.overrideLogicalId("example");
const azurermMonitorActionRuleActionGroupExample =
new azurerm.monitorActionRuleActionGroup.MonitorActionRuleActionGroup(
this,
"example_2",
{
action_group_id: azurermMonitorActionGroupExample.id,
name: "example-amar",
resource_group_name: azurermResourceGroupExample.name,
scope: [
{
resource_ids: [azurermResourceGroupExample.id],
type: "ResourceGroup",
},
],
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.*/
azurermMonitorActionRuleActionGroupExample.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. -
actionGroupId
- (Required) Specifies the resource id of monitor action group. -
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 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.