alicloud.arms.DispatchRule
Explore with Pulumi AI
Provides a Application Real-Time Monitoring Service (ARMS) Alert Dispatch Rule resource.
For information about Application Real-Time Monitoring Service (ARMS) Alert Dispatch Rule and how to use it, see What is Alert Dispatch_Rule.
NOTE: Available since v1.136.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = new alicloud.arms.AlertContact("default", {
alertContactName: "example_value",
email: "example_value@aaa.com",
});
const defaultAlertContactGroup = new alicloud.arms.AlertContactGroup("default", {
alertContactGroupName: "example_value",
contactIds: [_default.id],
});
const defaultDispatchRule = new alicloud.arms.DispatchRule("default", {
dispatchRuleName: "example_value",
dispatchType: "CREATE_ALERT",
groupRules: [{
groupWaitTime: 5,
groupInterval: 15,
repeatInterval: 100,
groupingFields: ["alertname"],
}],
labelMatchExpressionGrids: [{
labelMatchExpressionGroups: [{
labelMatchExpressions: [{
key: "_aliyun_arms_involvedObject_kind",
value: "app",
operator: "eq",
}],
}],
}],
notifyRules: [{
notifyObjects: [
{
notifyObjectId: _default.id,
notifyType: "ARMS_CONTACT",
name: "example_value",
},
{
notifyObjectId: defaultAlertContactGroup.id,
notifyType: "ARMS_CONTACT_GROUP",
name: "example_value",
},
],
notifyChannels: [
"dingTalk",
"wechat",
],
}],
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.arms.AlertContact("default",
alert_contact_name="example_value",
email="example_value@aaa.com")
default_alert_contact_group = alicloud.arms.AlertContactGroup("default",
alert_contact_group_name="example_value",
contact_ids=[default.id])
default_dispatch_rule = alicloud.arms.DispatchRule("default",
dispatch_rule_name="example_value",
dispatch_type="CREATE_ALERT",
group_rules=[{
"group_wait_time": 5,
"group_interval": 15,
"repeat_interval": 100,
"grouping_fields": ["alertname"],
}],
label_match_expression_grids=[{
"label_match_expression_groups": [{
"label_match_expressions": [{
"key": "_aliyun_arms_involvedObject_kind",
"value": "app",
"operator": "eq",
}],
}],
}],
notify_rules=[{
"notify_objects": [
{
"notify_object_id": default.id,
"notify_type": "ARMS_CONTACT",
"name": "example_value",
},
{
"notify_object_id": default_alert_contact_group.id,
"notify_type": "ARMS_CONTACT_GROUP",
"name": "example_value",
},
],
"notify_channels": [
"dingTalk",
"wechat",
],
}])
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := arms.NewAlertContact(ctx, "default", &arms.AlertContactArgs{
AlertContactName: pulumi.String("example_value"),
Email: pulumi.String("example_value@aaa.com"),
})
if err != nil {
return err
}
defaultAlertContactGroup, err := arms.NewAlertContactGroup(ctx, "default", &arms.AlertContactGroupArgs{
AlertContactGroupName: pulumi.String("example_value"),
ContactIds: pulumi.StringArray{
_default.ID(),
},
})
if err != nil {
return err
}
_, err = arms.NewDispatchRule(ctx, "default", &arms.DispatchRuleArgs{
DispatchRuleName: pulumi.String("example_value"),
DispatchType: pulumi.String("CREATE_ALERT"),
GroupRules: arms.DispatchRuleGroupRuleArray{
&arms.DispatchRuleGroupRuleArgs{
GroupWaitTime: pulumi.Int(5),
GroupInterval: pulumi.Int(15),
RepeatInterval: pulumi.Int(100),
GroupingFields: pulumi.StringArray{
pulumi.String("alertname"),
},
},
},
LabelMatchExpressionGrids: arms.DispatchRuleLabelMatchExpressionGridArray{
&arms.DispatchRuleLabelMatchExpressionGridArgs{
LabelMatchExpressionGroups: arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArray{
&arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs{
LabelMatchExpressions: arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArray{
&arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs{
Key: pulumi.String("_aliyun_arms_involvedObject_kind"),
Value: pulumi.String("app"),
Operator: pulumi.String("eq"),
},
},
},
},
},
},
NotifyRules: arms.DispatchRuleNotifyRuleArray{
&arms.DispatchRuleNotifyRuleArgs{
NotifyObjects: arms.DispatchRuleNotifyRuleNotifyObjectArray{
&arms.DispatchRuleNotifyRuleNotifyObjectArgs{
NotifyObjectId: _default.ID(),
NotifyType: pulumi.String("ARMS_CONTACT"),
Name: pulumi.String("example_value"),
},
&arms.DispatchRuleNotifyRuleNotifyObjectArgs{
NotifyObjectId: defaultAlertContactGroup.ID(),
NotifyType: pulumi.String("ARMS_CONTACT_GROUP"),
Name: pulumi.String("example_value"),
},
},
NotifyChannels: pulumi.StringArray{
pulumi.String("dingTalk"),
pulumi.String("wechat"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = new AliCloud.Arms.AlertContact("default", new()
{
AlertContactName = "example_value",
Email = "example_value@aaa.com",
});
var defaultAlertContactGroup = new AliCloud.Arms.AlertContactGroup("default", new()
{
AlertContactGroupName = "example_value",
ContactIds = new[]
{
@default.Id,
},
});
var defaultDispatchRule = new AliCloud.Arms.DispatchRule("default", new()
{
DispatchRuleName = "example_value",
DispatchType = "CREATE_ALERT",
GroupRules = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleGroupRuleArgs
{
GroupWaitTime = 5,
GroupInterval = 15,
RepeatInterval = 100,
GroupingFields = new[]
{
"alertname",
},
},
},
LabelMatchExpressionGrids = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridArgs
{
LabelMatchExpressionGroups = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs
{
LabelMatchExpressions = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs
{
Key = "_aliyun_arms_involvedObject_kind",
Value = "app",
Operator = "eq",
},
},
},
},
},
},
NotifyRules = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleArgs
{
NotifyObjects = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleNotifyObjectArgs
{
NotifyObjectId = @default.Id,
NotifyType = "ARMS_CONTACT",
Name = "example_value",
},
new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleNotifyObjectArgs
{
NotifyObjectId = defaultAlertContactGroup.Id,
NotifyType = "ARMS_CONTACT_GROUP",
Name = "example_value",
},
},
NotifyChannels = new[]
{
"dingTalk",
"wechat",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.arms.AlertContact;
import com.pulumi.alicloud.arms.AlertContactArgs;
import com.pulumi.alicloud.arms.AlertContactGroup;
import com.pulumi.alicloud.arms.AlertContactGroupArgs;
import com.pulumi.alicloud.arms.DispatchRule;
import com.pulumi.alicloud.arms.DispatchRuleArgs;
import com.pulumi.alicloud.arms.inputs.DispatchRuleGroupRuleArgs;
import com.pulumi.alicloud.arms.inputs.DispatchRuleLabelMatchExpressionGridArgs;
import com.pulumi.alicloud.arms.inputs.DispatchRuleNotifyRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new AlertContact("default", AlertContactArgs.builder()
.alertContactName("example_value")
.email("example_value@aaa.com")
.build());
var defaultAlertContactGroup = new AlertContactGroup("defaultAlertContactGroup", AlertContactGroupArgs.builder()
.alertContactGroupName("example_value")
.contactIds(default_.id())
.build());
var defaultDispatchRule = new DispatchRule("defaultDispatchRule", DispatchRuleArgs.builder()
.dispatchRuleName("example_value")
.dispatchType("CREATE_ALERT")
.groupRules(DispatchRuleGroupRuleArgs.builder()
.groupWaitTime(5)
.groupInterval(15)
.repeatInterval(100)
.groupingFields("alertname")
.build())
.labelMatchExpressionGrids(DispatchRuleLabelMatchExpressionGridArgs.builder()
.labelMatchExpressionGroups(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs.builder()
.labelMatchExpressions(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs.builder()
.key("_aliyun_arms_involvedObject_kind")
.value("app")
.operator("eq")
.build())
.build())
.build())
.notifyRules(DispatchRuleNotifyRuleArgs.builder()
.notifyObjects(
DispatchRuleNotifyRuleNotifyObjectArgs.builder()
.notifyObjectId(default_.id())
.notifyType("ARMS_CONTACT")
.name("example_value")
.build(),
DispatchRuleNotifyRuleNotifyObjectArgs.builder()
.notifyObjectId(defaultAlertContactGroup.id())
.notifyType("ARMS_CONTACT_GROUP")
.name("example_value")
.build())
.notifyChannels(
"dingTalk",
"wechat")
.build())
.build());
}
}
resources:
default:
type: alicloud:arms:AlertContact
properties:
alertContactName: example_value
email: example_value@aaa.com
defaultAlertContactGroup:
type: alicloud:arms:AlertContactGroup
name: default
properties:
alertContactGroupName: example_value
contactIds:
- ${default.id}
defaultDispatchRule:
type: alicloud:arms:DispatchRule
name: default
properties:
dispatchRuleName: example_value
dispatchType: CREATE_ALERT
groupRules:
- groupWaitTime: 5
groupInterval: 15
repeatInterval: 100
groupingFields:
- alertname
labelMatchExpressionGrids:
- labelMatchExpressionGroups:
- labelMatchExpressions:
- key: _aliyun_arms_involvedObject_kind
value: app
operator: eq
notifyRules:
- notifyObjects:
- notifyObjectId: ${default.id}
notifyType: ARMS_CONTACT
name: example_value
- notifyObjectId: ${defaultAlertContactGroup.id}
notifyType: ARMS_CONTACT_GROUP
name: example_value
notifyChannels:
- dingTalk
- wechat
Create DispatchRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DispatchRule(name: string, args: DispatchRuleArgs, opts?: CustomResourceOptions);
@overload
def DispatchRule(resource_name: str,
args: DispatchRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DispatchRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
dispatch_rule_name: Optional[str] = None,
group_rules: Optional[Sequence[DispatchRuleGroupRuleArgs]] = None,
label_match_expression_grids: Optional[Sequence[DispatchRuleLabelMatchExpressionGridArgs]] = None,
notify_rules: Optional[Sequence[DispatchRuleNotifyRuleArgs]] = None,
dispatch_type: Optional[str] = None,
is_recover: Optional[bool] = None)
func NewDispatchRule(ctx *Context, name string, args DispatchRuleArgs, opts ...ResourceOption) (*DispatchRule, error)
public DispatchRule(string name, DispatchRuleArgs args, CustomResourceOptions? opts = null)
public DispatchRule(String name, DispatchRuleArgs args)
public DispatchRule(String name, DispatchRuleArgs args, CustomResourceOptions options)
type: alicloud:arms:DispatchRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DispatchRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DispatchRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DispatchRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DispatchRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DispatchRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var dispatchRuleResource = new AliCloud.Arms.DispatchRule("dispatchRuleResource", new()
{
DispatchRuleName = "string",
GroupRules = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleGroupRuleArgs
{
GroupInterval = 0,
GroupWaitTime = 0,
GroupingFields = new[]
{
"string",
},
GroupId = 0,
RepeatInterval = 0,
},
},
LabelMatchExpressionGrids = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridArgs
{
LabelMatchExpressionGroups = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs
{
LabelMatchExpressions = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs
{
Key = "string",
Operator = "string",
Value = "string",
},
},
},
},
},
},
NotifyRules = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleArgs
{
NotifyChannels = new[]
{
"string",
},
NotifyObjects = new[]
{
new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleNotifyObjectArgs
{
Name = "string",
NotifyObjectId = "string",
NotifyType = "string",
},
},
},
},
DispatchType = "string",
IsRecover = false,
});
example, err := arms.NewDispatchRule(ctx, "dispatchRuleResource", &arms.DispatchRuleArgs{
DispatchRuleName: pulumi.String("string"),
GroupRules: arms.DispatchRuleGroupRuleArray{
&arms.DispatchRuleGroupRuleArgs{
GroupInterval: pulumi.Int(0),
GroupWaitTime: pulumi.Int(0),
GroupingFields: pulumi.StringArray{
pulumi.String("string"),
},
GroupId: pulumi.Int(0),
RepeatInterval: pulumi.Int(0),
},
},
LabelMatchExpressionGrids: arms.DispatchRuleLabelMatchExpressionGridArray{
&arms.DispatchRuleLabelMatchExpressionGridArgs{
LabelMatchExpressionGroups: arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArray{
&arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs{
LabelMatchExpressions: arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArray{
&arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs{
Key: pulumi.String("string"),
Operator: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
},
},
},
},
NotifyRules: arms.DispatchRuleNotifyRuleArray{
&arms.DispatchRuleNotifyRuleArgs{
NotifyChannels: pulumi.StringArray{
pulumi.String("string"),
},
NotifyObjects: arms.DispatchRuleNotifyRuleNotifyObjectArray{
&arms.DispatchRuleNotifyRuleNotifyObjectArgs{
Name: pulumi.String("string"),
NotifyObjectId: pulumi.String("string"),
NotifyType: pulumi.String("string"),
},
},
},
},
DispatchType: pulumi.String("string"),
IsRecover: pulumi.Bool(false),
})
var dispatchRuleResource = new DispatchRule("dispatchRuleResource", DispatchRuleArgs.builder()
.dispatchRuleName("string")
.groupRules(DispatchRuleGroupRuleArgs.builder()
.groupInterval(0)
.groupWaitTime(0)
.groupingFields("string")
.groupId(0)
.repeatInterval(0)
.build())
.labelMatchExpressionGrids(DispatchRuleLabelMatchExpressionGridArgs.builder()
.labelMatchExpressionGroups(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs.builder()
.labelMatchExpressions(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs.builder()
.key("string")
.operator("string")
.value("string")
.build())
.build())
.build())
.notifyRules(DispatchRuleNotifyRuleArgs.builder()
.notifyChannels("string")
.notifyObjects(DispatchRuleNotifyRuleNotifyObjectArgs.builder()
.name("string")
.notifyObjectId("string")
.notifyType("string")
.build())
.build())
.dispatchType("string")
.isRecover(false)
.build());
dispatch_rule_resource = alicloud.arms.DispatchRule("dispatchRuleResource",
dispatch_rule_name="string",
group_rules=[alicloud.arms.DispatchRuleGroupRuleArgs(
group_interval=0,
group_wait_time=0,
grouping_fields=["string"],
group_id=0,
repeat_interval=0,
)],
label_match_expression_grids=[alicloud.arms.DispatchRuleLabelMatchExpressionGridArgs(
label_match_expression_groups=[alicloud.arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs(
label_match_expressions=[alicloud.arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs(
key="string",
operator="string",
value="string",
)],
)],
)],
notify_rules=[alicloud.arms.DispatchRuleNotifyRuleArgs(
notify_channels=["string"],
notify_objects=[alicloud.arms.DispatchRuleNotifyRuleNotifyObjectArgs(
name="string",
notify_object_id="string",
notify_type="string",
)],
)],
dispatch_type="string",
is_recover=False)
const dispatchRuleResource = new alicloud.arms.DispatchRule("dispatchRuleResource", {
dispatchRuleName: "string",
groupRules: [{
groupInterval: 0,
groupWaitTime: 0,
groupingFields: ["string"],
groupId: 0,
repeatInterval: 0,
}],
labelMatchExpressionGrids: [{
labelMatchExpressionGroups: [{
labelMatchExpressions: [{
key: "string",
operator: "string",
value: "string",
}],
}],
}],
notifyRules: [{
notifyChannels: ["string"],
notifyObjects: [{
name: "string",
notifyObjectId: "string",
notifyType: "string",
}],
}],
dispatchType: "string",
isRecover: false,
});
type: alicloud:arms:DispatchRule
properties:
dispatchRuleName: string
dispatchType: string
groupRules:
- groupId: 0
groupInterval: 0
groupWaitTime: 0
groupingFields:
- string
repeatInterval: 0
isRecover: false
labelMatchExpressionGrids:
- labelMatchExpressionGroups:
- labelMatchExpressions:
- key: string
operator: string
value: string
notifyRules:
- notifyChannels:
- string
notifyObjects:
- name: string
notifyObjectId: string
notifyType: string
DispatchRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The DispatchRule resource accepts the following input properties:
- Dispatch
Rule stringName - The name of the dispatch policy.
- Group
Rules List<Pulumi.Ali Cloud. Arms. Inputs. Dispatch Rule Group Rule> - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Label
Match List<Pulumi.Expression Grids Ali Cloud. Arms. Inputs. Dispatch Rule Label Match Expression Grid> - Sets the dispatch rule. See
label_match_expression_grid
below. - Notify
Rules List<Pulumi.Ali Cloud. Arms. Inputs. Dispatch Rule Notify Rule> - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Dispatch
Type string - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- Is
Recover bool - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- Dispatch
Rule stringName - The name of the dispatch policy.
- Group
Rules []DispatchRule Group Rule Args - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Label
Match []DispatchExpression Grids Rule Label Match Expression Grid Args - Sets the dispatch rule. See
label_match_expression_grid
below. - Notify
Rules []DispatchRule Notify Rule Args - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Dispatch
Type string - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- Is
Recover bool - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- dispatch
Rule StringName - The name of the dispatch policy.
- group
Rules List<DispatchRule Group Rule> - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - label
Match List<DispatchExpression Grids Rule Label Match Expression Grid> - Sets the dispatch rule. See
label_match_expression_grid
below. - notify
Rules List<DispatchRule Notify Rule> - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - dispatch
Type String - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- is
Recover Boolean - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- dispatch
Rule stringName - The name of the dispatch policy.
- group
Rules DispatchRule Group Rule[] - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - label
Match DispatchExpression Grids Rule Label Match Expression Grid[] - Sets the dispatch rule. See
label_match_expression_grid
below. - notify
Rules DispatchRule Notify Rule[] - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - dispatch
Type string - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- is
Recover boolean - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- dispatch_
rule_ strname - The name of the dispatch policy.
- group_
rules Sequence[DispatchRule Group Rule Args] - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - label_
match_ Sequence[Dispatchexpression_ grids Rule Label Match Expression Grid Args] - Sets the dispatch rule. See
label_match_expression_grid
below. - notify_
rules Sequence[DispatchRule Notify Rule Args] - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - dispatch_
type str - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- is_
recover bool - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- dispatch
Rule StringName - The name of the dispatch policy.
- group
Rules List<Property Map> - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - label
Match List<Property Map>Expression Grids - Sets the dispatch rule. See
label_match_expression_grid
below. - notify
Rules List<Property Map> - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - dispatch
Type String - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- is
Recover Boolean - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
Outputs
All input properties are implicitly available as output properties. Additionally, the DispatchRule resource produces the following output properties:
Look up Existing DispatchRule Resource
Get an existing DispatchRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DispatchRuleState, opts?: CustomResourceOptions): DispatchRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dispatch_rule_name: Optional[str] = None,
dispatch_type: Optional[str] = None,
group_rules: Optional[Sequence[DispatchRuleGroupRuleArgs]] = None,
is_recover: Optional[bool] = None,
label_match_expression_grids: Optional[Sequence[DispatchRuleLabelMatchExpressionGridArgs]] = None,
notify_rules: Optional[Sequence[DispatchRuleNotifyRuleArgs]] = None,
status: Optional[str] = None) -> DispatchRule
func GetDispatchRule(ctx *Context, name string, id IDInput, state *DispatchRuleState, opts ...ResourceOption) (*DispatchRule, error)
public static DispatchRule Get(string name, Input<string> id, DispatchRuleState? state, CustomResourceOptions? opts = null)
public static DispatchRule get(String name, Output<String> id, DispatchRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Dispatch
Rule stringName - The name of the dispatch policy.
- Dispatch
Type string - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- Group
Rules List<Pulumi.Ali Cloud. Arms. Inputs. Dispatch Rule Group Rule> - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Is
Recover bool - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- Label
Match List<Pulumi.Expression Grids Ali Cloud. Arms. Inputs. Dispatch Rule Label Match Expression Grid> - Sets the dispatch rule. See
label_match_expression_grid
below. - Notify
Rules List<Pulumi.Ali Cloud. Arms. Inputs. Dispatch Rule Notify Rule> - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Status string
- The resource status of Alert Dispatch Rule.
- Dispatch
Rule stringName - The name of the dispatch policy.
- Dispatch
Type string - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- Group
Rules []DispatchRule Group Rule Args - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Is
Recover bool - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- Label
Match []DispatchExpression Grids Rule Label Match Expression Grid Args - Sets the dispatch rule. See
label_match_expression_grid
below. - Notify
Rules []DispatchRule Notify Rule Args - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - Status string
- The resource status of Alert Dispatch Rule.
- dispatch
Rule StringName - The name of the dispatch policy.
- dispatch
Type String - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- group
Rules List<DispatchRule Group Rule> - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - is
Recover Boolean - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- label
Match List<DispatchExpression Grids Rule Label Match Expression Grid> - Sets the dispatch rule. See
label_match_expression_grid
below. - notify
Rules List<DispatchRule Notify Rule> - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - status String
- The resource status of Alert Dispatch Rule.
- dispatch
Rule stringName - The name of the dispatch policy.
- dispatch
Type string - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- group
Rules DispatchRule Group Rule[] - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - is
Recover boolean - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- label
Match DispatchExpression Grids Rule Label Match Expression Grid[] - Sets the dispatch rule. See
label_match_expression_grid
below. - notify
Rules DispatchRule Notify Rule[] - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - status string
- The resource status of Alert Dispatch Rule.
- dispatch_
rule_ strname - The name of the dispatch policy.
- dispatch_
type str - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- group_
rules Sequence[DispatchRule Group Rule Args] - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - is_
recover bool - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- label_
match_ Sequence[Dispatchexpression_ grids Rule Label Match Expression Grid Args] - Sets the dispatch rule. See
label_match_expression_grid
below. - notify_
rules Sequence[DispatchRule Notify Rule Args] - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - status str
- The resource status of Alert Dispatch Rule.
- dispatch
Rule StringName - The name of the dispatch policy.
- dispatch
Type String - The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
- group
Rules List<Property Map> - Sets the event group. See
group_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - is
Recover Boolean - Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
- label
Match List<Property Map>Expression Grids - Sets the dispatch rule. See
label_match_expression_grid
below. - notify
Rules List<Property Map> - Sets the notification rule. See
notify_rules
below. It will be ignored whendispatch_type = "DISCARD_ALERT"
. - status String
- The resource status of Alert Dispatch Rule.
Supporting Types
DispatchRuleGroupRule, DispatchRuleGroupRuleArgs
- Group
Interval int - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- Group
Wait intTime - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- Grouping
Fields List<string> - The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
- Group
Id int - The ID of the group rule.
- Repeat
Interval int - The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
- Group
Interval int - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- Group
Wait intTime - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- Grouping
Fields []string - The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
- Group
Id int - The ID of the group rule.
- Repeat
Interval int - The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
- group
Interval Integer - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- group
Wait IntegerTime - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- grouping
Fields List<String> - The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
- group
Id Integer - The ID of the group rule.
- repeat
Interval Integer - The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
- group
Interval number - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- group
Wait numberTime - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- grouping
Fields string[] - The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
- group
Id number - The ID of the group rule.
- repeat
Interval number - The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
- group_
interval int - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- group_
wait_ inttime - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- grouping_
fields Sequence[str] - The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
- group_
id int - The ID of the group rule.
- repeat_
interval int - The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
- group
Interval Number - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- group
Wait NumberTime - The duration for which the system waits after the first alert is sent. After the duration, all alerts are sent in a single notification to the handler.
- grouping
Fields List<String> - The fields that are used to group events. Events with the same field content are assigned to a group. Alerts with the same specified grouping field are sent to the handler in separate notifications.
- group
Id Number - The ID of the group rule.
- repeat
Interval Number - The silence period of repeated alerts. All alerts are repeatedly sent at specified intervals until the alerts are cleared. The minimum value is 61. Default to 600.
DispatchRuleLabelMatchExpressionGrid, DispatchRuleLabelMatchExpressionGridArgs
- Label
Match List<Pulumi.Expression Groups Ali Cloud. Arms. Inputs. Dispatch Rule Label Match Expression Grid Label Match Expression Group> - Sets the dispatch rule. See
label_match_expression_groups
below.
- Label
Match []DispatchExpression Groups Rule Label Match Expression Grid Label Match Expression Group - Sets the dispatch rule. See
label_match_expression_groups
below.
- label
Match List<DispatchExpression Groups Rule Label Match Expression Grid Label Match Expression Group> - Sets the dispatch rule. See
label_match_expression_groups
below.
- label
Match DispatchExpression Groups Rule Label Match Expression Grid Label Match Expression Group[] - Sets the dispatch rule. See
label_match_expression_groups
below.
- label_
match_ Sequence[Dispatchexpression_ groups Rule Label Match Expression Grid Label Match Expression Group] - Sets the dispatch rule. See
label_match_expression_groups
below.
- label
Match List<Property Map>Expression Groups - Sets the dispatch rule. See
label_match_expression_groups
below.
DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroup, DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs
- Label
Match List<Pulumi.Expressions Ali Cloud. Arms. Inputs. Dispatch Rule Label Match Expression Grid Label Match Expression Group Label Match Expression> - Sets the dispatch rule. See
label_match_expressions
below.
- Label
Match []DispatchExpressions Rule Label Match Expression Grid Label Match Expression Group Label Match Expression - Sets the dispatch rule. See
label_match_expressions
below.
- label
Match List<DispatchExpressions Rule Label Match Expression Grid Label Match Expression Group Label Match Expression> - Sets the dispatch rule. See
label_match_expressions
below.
- label
Match DispatchExpressions Rule Label Match Expression Grid Label Match Expression Group Label Match Expression[] - Sets the dispatch rule. See
label_match_expressions
below.
- label_
match_ Sequence[Dispatchexpressions Rule Label Match Expression Grid Label Match Expression Group Label Match Expression] - Sets the dispatch rule. See
label_match_expressions
below.
- label
Match List<Property Map>Expressions - Sets the dispatch rule. See
label_match_expressions
below.
DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpression, DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs
- Key string
- The key of the tag of the dispatch rule. Valid values:
- _aliyun_arms_userid: user ID
- _aliyun_arms_involvedObject_kind: type of the associated object
- _aliyun_arms_involvedObject_id: ID of the associated object
- _aliyun_arms_involvedObject_name: name of the associated object
- _aliyun_arms_alert_name: alert name
- _aliyun_arms_alert_rule_id: alert rule ID
- _aliyun_arms_alert_type: alert type
- _aliyun_arms_alert_level: alert severity
- Operator string
- The operator used in the dispatch rule. Valid values:
- eq: equals to.
- re: matches a regular expression.
- Value string
- The value of the tag.
- Key string
- The key of the tag of the dispatch rule. Valid values:
- _aliyun_arms_userid: user ID
- _aliyun_arms_involvedObject_kind: type of the associated object
- _aliyun_arms_involvedObject_id: ID of the associated object
- _aliyun_arms_involvedObject_name: name of the associated object
- _aliyun_arms_alert_name: alert name
- _aliyun_arms_alert_rule_id: alert rule ID
- _aliyun_arms_alert_type: alert type
- _aliyun_arms_alert_level: alert severity
- Operator string
- The operator used in the dispatch rule. Valid values:
- eq: equals to.
- re: matches a regular expression.
- Value string
- The value of the tag.
- key String
- The key of the tag of the dispatch rule. Valid values:
- _aliyun_arms_userid: user ID
- _aliyun_arms_involvedObject_kind: type of the associated object
- _aliyun_arms_involvedObject_id: ID of the associated object
- _aliyun_arms_involvedObject_name: name of the associated object
- _aliyun_arms_alert_name: alert name
- _aliyun_arms_alert_rule_id: alert rule ID
- _aliyun_arms_alert_type: alert type
- _aliyun_arms_alert_level: alert severity
- operator String
- The operator used in the dispatch rule. Valid values:
- eq: equals to.
- re: matches a regular expression.
- value String
- The value of the tag.
- key string
- The key of the tag of the dispatch rule. Valid values:
- _aliyun_arms_userid: user ID
- _aliyun_arms_involvedObject_kind: type of the associated object
- _aliyun_arms_involvedObject_id: ID of the associated object
- _aliyun_arms_involvedObject_name: name of the associated object
- _aliyun_arms_alert_name: alert name
- _aliyun_arms_alert_rule_id: alert rule ID
- _aliyun_arms_alert_type: alert type
- _aliyun_arms_alert_level: alert severity
- operator string
- The operator used in the dispatch rule. Valid values:
- eq: equals to.
- re: matches a regular expression.
- value string
- The value of the tag.
- key str
- The key of the tag of the dispatch rule. Valid values:
- _aliyun_arms_userid: user ID
- _aliyun_arms_involvedObject_kind: type of the associated object
- _aliyun_arms_involvedObject_id: ID of the associated object
- _aliyun_arms_involvedObject_name: name of the associated object
- _aliyun_arms_alert_name: alert name
- _aliyun_arms_alert_rule_id: alert rule ID
- _aliyun_arms_alert_type: alert type
- _aliyun_arms_alert_level: alert severity
- operator str
- The operator used in the dispatch rule. Valid values:
- eq: equals to.
- re: matches a regular expression.
- value str
- The value of the tag.
- key String
- The key of the tag of the dispatch rule. Valid values:
- _aliyun_arms_userid: user ID
- _aliyun_arms_involvedObject_kind: type of the associated object
- _aliyun_arms_involvedObject_id: ID of the associated object
- _aliyun_arms_involvedObject_name: name of the associated object
- _aliyun_arms_alert_name: alert name
- _aliyun_arms_alert_rule_id: alert rule ID
- _aliyun_arms_alert_type: alert type
- _aliyun_arms_alert_level: alert severity
- operator String
- The operator used in the dispatch rule. Valid values:
- eq: equals to.
- re: matches a regular expression.
- value String
- The value of the tag.
DispatchRuleNotifyRule, DispatchRuleNotifyRuleArgs
- Notify
Channels List<string> - The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
- Notify
Objects List<Pulumi.Ali Cloud. Arms. Inputs. Dispatch Rule Notify Rule Notify Object> - Sets the notification object. See
notify_objects
below.
- Notify
Channels []string - The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
- Notify
Objects []DispatchRule Notify Rule Notify Object - Sets the notification object. See
notify_objects
below.
- notify
Channels List<String> - The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
- notify
Objects List<DispatchRule Notify Rule Notify Object> - Sets the notification object. See
notify_objects
below.
- notify
Channels string[] - The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
- notify
Objects DispatchRule Notify Rule Notify Object[] - Sets the notification object. See
notify_objects
below.
- notify_
channels Sequence[str] - The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
- notify_
objects Sequence[DispatchRule Notify Rule Notify Object] - Sets the notification object. See
notify_objects
below.
- notify
Channels List<String> - The notification method. Valid values: dingTalk, sms, webhook, email, and wechat.
- notify
Objects List<Property Map> - Sets the notification object. See
notify_objects
below.
DispatchRuleNotifyRuleNotifyObject, DispatchRuleNotifyRuleNotifyObjectArgs
- Name string
- The name of the contact or contact group.
- Notify
Object stringId - The ID of the contact or contact group.
- Notify
Type string - The type of the alert contact. Valid values: ARMS_CONTACT: contact. ARMS_CONTACT_GROUP: contact group.
- Name string
- The name of the contact or contact group.
- Notify
Object stringId - The ID of the contact or contact group.
- Notify
Type string - The type of the alert contact. Valid values: ARMS_CONTACT: contact. ARMS_CONTACT_GROUP: contact group.
- name String
- The name of the contact or contact group.
- notify
Object StringId - The ID of the contact or contact group.
- notify
Type String - The type of the alert contact. Valid values: ARMS_CONTACT: contact. ARMS_CONTACT_GROUP: contact group.
- name string
- The name of the contact or contact group.
- notify
Object stringId - The ID of the contact or contact group.
- notify
Type string - The type of the alert contact. Valid values: ARMS_CONTACT: contact. ARMS_CONTACT_GROUP: contact group.
- name str
- The name of the contact or contact group.
- notify_
object_ strid - The ID of the contact or contact group.
- notify_
type str - The type of the alert contact. Valid values: ARMS_CONTACT: contact. ARMS_CONTACT_GROUP: contact group.
- name String
- The name of the contact or contact group.
- notify
Object StringId - The ID of the contact or contact group.
- notify
Type String - The type of the alert contact. Valid values: ARMS_CONTACT: contact. ARMS_CONTACT_GROUP: contact group.
Import
Application Real-Time Monitoring Service (ARMS) Alert Contact can be imported using the id, e.g.
$ pulumi import alicloud:arms/dispatchRule:DispatchRule example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.