alicloud.cms.EventRule
Explore with Pulumi AI
Provides a Cloud Monitor Service Event Rule resource.
For information about Cloud Monitor Service Event Rule and how to use it, see What is Event Rule.
NOTE: Available in v1.182.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = new AliCloud.Cms.MonitorGroup("default", new()
{
MonitorGroupName = "example_value",
});
var example = new AliCloud.Cms.EventRule("example", new()
{
RuleName = "example_value",
GroupId = @default.Id,
Description = "example_value",
Status = "ENABLED",
EventPattern = new AliCloud.Cms.Inputs.EventRuleEventPatternArgs
{
Product = "ecs",
EventTypeLists = new[]
{
"StatusNotification",
},
LevelLists = new[]
{
"CRITICAL",
},
NameLists = new[]
{
"example_value",
},
SqlFilter = "example_value",
},
SilenceTime = 100,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cms.NewMonitorGroup(ctx, "default", &cms.MonitorGroupArgs{
MonitorGroupName: pulumi.String("example_value"),
})
if err != nil {
return err
}
_, err = cms.NewEventRule(ctx, "example", &cms.EventRuleArgs{
RuleName: pulumi.String("example_value"),
GroupId: _default.ID(),
Description: pulumi.String("example_value"),
Status: pulumi.String("ENABLED"),
EventPattern: &cms.EventRuleEventPatternArgs{
Product: pulumi.String("ecs"),
EventTypeLists: pulumi.StringArray{
pulumi.String("StatusNotification"),
},
LevelLists: pulumi.StringArray{
pulumi.String("CRITICAL"),
},
NameLists: pulumi.StringArray{
pulumi.String("example_value"),
},
SqlFilter: pulumi.String("example_value"),
},
SilenceTime: pulumi.Int(100),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cms.MonitorGroup;
import com.pulumi.alicloud.cms.MonitorGroupArgs;
import com.pulumi.alicloud.cms.EventRule;
import com.pulumi.alicloud.cms.EventRuleArgs;
import com.pulumi.alicloud.cms.inputs.EventRuleEventPatternArgs;
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 MonitorGroup("default", MonitorGroupArgs.builder()
.monitorGroupName("example_value")
.build());
var example = new EventRule("example", EventRuleArgs.builder()
.ruleName("example_value")
.groupId(default_.id())
.description("example_value")
.status("ENABLED")
.eventPattern(EventRuleEventPatternArgs.builder()
.product("ecs")
.eventTypeLists("StatusNotification")
.levelLists("CRITICAL")
.nameLists("example_value")
.sqlFilter("example_value")
.build())
.silenceTime(100)
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.cms.MonitorGroup("default", monitor_group_name="example_value")
example = alicloud.cms.EventRule("example",
rule_name="example_value",
group_id=default.id,
description="example_value",
status="ENABLED",
event_pattern=alicloud.cms.EventRuleEventPatternArgs(
product="ecs",
event_type_lists=["StatusNotification"],
level_lists=["CRITICAL"],
name_lists=["example_value"],
sql_filter="example_value",
),
silence_time=100)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = new alicloud.cms.MonitorGroup("default", {monitorGroupName: "example_value"});
const example = new alicloud.cms.EventRule("example", {
ruleName: "example_value",
groupId: _default.id,
description: "example_value",
status: "ENABLED",
eventPattern: {
product: "ecs",
eventTypeLists: ["StatusNotification"],
levelLists: ["CRITICAL"],
nameLists: ["example_value"],
sqlFilter: "example_value",
},
silenceTime: 100,
});
resources:
default:
type: alicloud:cms:MonitorGroup
properties:
monitorGroupName: example_value
example:
type: alicloud:cms:EventRule
properties:
ruleName: example_value
groupId: ${default.id}
description: example_value
status: ENABLED
eventPattern:
product: ecs
eventTypeLists:
- StatusNotification
levelLists:
- CRITICAL
nameLists:
- example_value
sqlFilter: example_value
silenceTime: 100
Create EventRule Resource
new EventRule(name: string, args: EventRuleArgs, opts?: CustomResourceOptions);
@overload
def EventRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
event_pattern: Optional[EventRuleEventPatternArgs] = None,
group_id: Optional[str] = None,
rule_name: Optional[str] = None,
silence_time: Optional[int] = None,
status: Optional[str] = None)
@overload
def EventRule(resource_name: str,
args: EventRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewEventRule(ctx *Context, name string, args EventRuleArgs, opts ...ResourceOption) (*EventRule, error)
public EventRule(string name, EventRuleArgs args, CustomResourceOptions? opts = null)
public EventRule(String name, EventRuleArgs args)
public EventRule(String name, EventRuleArgs args, CustomResourceOptions options)
type: alicloud:cms:EventRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EventRuleArgs
- 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 EventRuleArgs
- 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 EventRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EventRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EventRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
EventRule 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 EventRule resource accepts the following input properties:
- Event
Pattern Pulumi.Ali Cloud. Cms. Inputs. Event Rule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- Rule
Name string The name of the event-triggered alert rule.
- Description string
The description of the event-triggered alert rule.
- Group
Id string The ID of the application group to which the event-triggered alert rule belongs.
- Silence
Time int The silence time.
- Status string
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- Event
Pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- Rule
Name string The name of the event-triggered alert rule.
- Description string
The description of the event-triggered alert rule.
- Group
Id string The ID of the application group to which the event-triggered alert rule belongs.
- Silence
Time int The silence time.
- Status string
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- event
Pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- rule
Name String The name of the event-triggered alert rule.
- description String
The description of the event-triggered alert rule.
- group
Id String The ID of the application group to which the event-triggered alert rule belongs.
- silence
Time Integer The silence time.
- status String
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- event
Pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- rule
Name string The name of the event-triggered alert rule.
- description string
The description of the event-triggered alert rule.
- group
Id string The ID of the application group to which the event-triggered alert rule belongs.
- silence
Time number The silence time.
- status string
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- event_
pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- rule_
name str The name of the event-triggered alert rule.
- description str
The description of the event-triggered alert rule.
- group_
id str The ID of the application group to which the event-triggered alert rule belongs.
- silence_
time int The silence time.
- status str
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- event
Pattern Property Map Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- rule
Name String The name of the event-triggered alert rule.
- description String
The description of the event-triggered alert rule.
- group
Id String The ID of the application group to which the event-triggered alert rule belongs.
- silence
Time Number The silence time.
- status String
The status of the resource. Valid values:
ENABLED
,DISABLED
.
Outputs
All input properties are implicitly available as output properties. Additionally, the EventRule resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing EventRule Resource
Get an existing EventRule 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?: EventRuleState, opts?: CustomResourceOptions): EventRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
event_pattern: Optional[EventRuleEventPatternArgs] = None,
group_id: Optional[str] = None,
rule_name: Optional[str] = None,
silence_time: Optional[int] = None,
status: Optional[str] = None) -> EventRule
func GetEventRule(ctx *Context, name string, id IDInput, state *EventRuleState, opts ...ResourceOption) (*EventRule, error)
public static EventRule Get(string name, Input<string> id, EventRuleState? state, CustomResourceOptions? opts = null)
public static EventRule get(String name, Output<String> id, EventRuleState 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.
- Description string
The description of the event-triggered alert rule.
- Event
Pattern Pulumi.Ali Cloud. Cms. Inputs. Event Rule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- Group
Id string The ID of the application group to which the event-triggered alert rule belongs.
- Rule
Name string The name of the event-triggered alert rule.
- Silence
Time int The silence time.
- Status string
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- Description string
The description of the event-triggered alert rule.
- Event
Pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- Group
Id string The ID of the application group to which the event-triggered alert rule belongs.
- Rule
Name string The name of the event-triggered alert rule.
- Silence
Time int The silence time.
- Status string
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- description String
The description of the event-triggered alert rule.
- event
Pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- group
Id String The ID of the application group to which the event-triggered alert rule belongs.
- rule
Name String The name of the event-triggered alert rule.
- silence
Time Integer The silence time.
- status String
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- description string
The description of the event-triggered alert rule.
- event
Pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- group
Id string The ID of the application group to which the event-triggered alert rule belongs.
- rule
Name string The name of the event-triggered alert rule.
- silence
Time number The silence time.
- status string
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- description str
The description of the event-triggered alert rule.
- event_
pattern EventRule Event Pattern Args Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- group_
id str The ID of the application group to which the event-triggered alert rule belongs.
- rule_
name str The name of the event-triggered alert rule.
- silence_
time int The silence time.
- status str
The status of the resource. Valid values:
ENABLED
,DISABLED
.
- description String
The description of the event-triggered alert rule.
- event
Pattern Property Map Event mode, used to describe the trigger conditions for this event. See the following
Block event_pattern
.- group
Id String The ID of the application group to which the event-triggered alert rule belongs.
- rule
Name String The name of the event-triggered alert rule.
- silence
Time Number The silence time.
- status String
The status of the resource. Valid values:
ENABLED
,DISABLED
.
Supporting Types
EventRuleEventPattern
- Product string
The type of the cloud service.
- Event
Type List<string>Lists The type of the event-triggered alert rule. Valid values:
- Level
Lists List<string> The level of the event-triggered alert rule. Valid values:
- Name
Lists List<string> The name of the event-triggered alert rule.
- Sql
Filter string The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.
- Product string
The type of the cloud service.
- Event
Type []stringLists The type of the event-triggered alert rule. Valid values:
- Level
Lists []string The level of the event-triggered alert rule. Valid values:
- Name
Lists []string The name of the event-triggered alert rule.
- Sql
Filter string The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.
- product String
The type of the cloud service.
- event
Type List<String>Lists The type of the event-triggered alert rule. Valid values:
- level
Lists List<String> The level of the event-triggered alert rule. Valid values:
- name
Lists List<String> The name of the event-triggered alert rule.
- sql
Filter String The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.
- product string
The type of the cloud service.
- event
Type string[]Lists The type of the event-triggered alert rule. Valid values:
- level
Lists string[] The level of the event-triggered alert rule. Valid values:
- name
Lists string[] The name of the event-triggered alert rule.
- sql
Filter string The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.
- product str
The type of the cloud service.
- event_
type_ Sequence[str]lists The type of the event-triggered alert rule. Valid values:
- level_
lists Sequence[str] The level of the event-triggered alert rule. Valid values:
- name_
lists Sequence[str] The name of the event-triggered alert rule.
- sql_
filter str The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.
- product String
The type of the cloud service.
- event
Type List<String>Lists The type of the event-triggered alert rule. Valid values:
- level
Lists List<String> The level of the event-triggered alert rule. Valid values:
- name
Lists List<String> The name of the event-triggered alert rule.
- sql
Filter String The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.
Import
Cloud Monitor Service Event Rule can be imported using the id, e.g.
$ pulumi import alicloud:cms/eventRule:EventRule example <rule_name>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.