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 since v1.182.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = new alicloud.cms.MonitorGroup("default", {monitorGroupName: name});
const example = new alicloud.cms.EventRule("example", {
ruleName: name,
groupId: _default.id,
silenceTime: 100,
description: name,
status: "ENABLED",
eventPattern: {
product: "ecs",
sqlFilter: "example_value",
nameLists: ["example_value"],
levelLists: ["CRITICAL"],
eventTypeLists: ["StatusNotification"],
},
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.cms.MonitorGroup("default", monitor_group_name=name)
example = alicloud.cms.EventRule("example",
rule_name=name,
group_id=default.id,
silence_time=100,
description=name,
status="ENABLED",
event_pattern={
"product": "ecs",
"sql_filter": "example_value",
"name_lists": ["example_value"],
"level_lists": ["CRITICAL"],
"event_type_lists": ["StatusNotification"],
})
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := cms.NewMonitorGroup(ctx, "default", &cms.MonitorGroupArgs{
MonitorGroupName: pulumi.String(name),
})
if err != nil {
return err
}
_, err = cms.NewEventRule(ctx, "example", &cms.EventRuleArgs{
RuleName: pulumi.String(name),
GroupId: _default.ID(),
SilenceTime: pulumi.Int(100),
Description: pulumi.String(name),
Status: pulumi.String("ENABLED"),
EventPattern: &cms.EventRuleEventPatternArgs{
Product: pulumi.String("ecs"),
SqlFilter: pulumi.String("example_value"),
NameLists: pulumi.StringArray{
pulumi.String("example_value"),
},
LevelLists: pulumi.StringArray{
pulumi.String("CRITICAL"),
},
EventTypeLists: pulumi.StringArray{
pulumi.String("StatusNotification"),
},
},
})
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 config = new Config();
var name = config.Get("name") ?? "tf-example";
var @default = new AliCloud.Cms.MonitorGroup("default", new()
{
MonitorGroupName = name,
});
var example = new AliCloud.Cms.EventRule("example", new()
{
RuleName = name,
GroupId = @default.Id,
SilenceTime = 100,
Description = name,
Status = "ENABLED",
EventPattern = new AliCloud.Cms.Inputs.EventRuleEventPatternArgs
{
Product = "ecs",
SqlFilter = "example_value",
NameLists = new[]
{
"example_value",
},
LevelLists = new[]
{
"CRITICAL",
},
EventTypeLists = new[]
{
"StatusNotification",
},
},
});
});
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var default_ = new MonitorGroup("default", MonitorGroupArgs.builder()
.monitorGroupName(name)
.build());
var example = new EventRule("example", EventRuleArgs.builder()
.ruleName(name)
.groupId(default_.id())
.silenceTime(100)
.description(name)
.status("ENABLED")
.eventPattern(EventRuleEventPatternArgs.builder()
.product("ecs")
.sqlFilter("example_value")
.nameLists("example_value")
.levelLists("CRITICAL")
.eventTypeLists("StatusNotification")
.build())
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
default:
type: alicloud:cms:MonitorGroup
properties:
monitorGroupName: ${name}
example:
type: alicloud:cms:EventRule
properties:
ruleName: ${name}
groupId: ${default.id}
silenceTime: 100
description: ${name}
status: ENABLED
eventPattern:
product: ecs
sqlFilter: example_value
nameLists:
- example_value
levelLists:
- CRITICAL
eventTypeLists:
- StatusNotification
Create EventRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EventRule(name: string, args: EventRuleArgs, opts?: CustomResourceOptions);
@overload
def EventRule(resource_name: str,
args: EventRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EventRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
event_pattern: Optional[EventRuleEventPatternArgs] = None,
rule_name: Optional[str] = None,
contact_parameters: Optional[Sequence[EventRuleContactParameterArgs]] = None,
description: Optional[str] = None,
fc_parameters: Optional[Sequence[EventRuleFcParameterArgs]] = None,
group_id: Optional[str] = None,
mns_parameters: Optional[Sequence[EventRuleMnsParameterArgs]] = None,
open_api_parameters: Optional[Sequence[EventRuleOpenApiParameterArgs]] = None,
silence_time: Optional[int] = None,
sls_parameters: Optional[Sequence[EventRuleSlsParameterArgs]] = None,
status: Optional[str] = None,
webhook_parameters: Optional[Sequence[EventRuleWebhookParameterArgs]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var eventRuleResource = new AliCloud.Cms.EventRule("eventRuleResource", new()
{
EventPattern = new AliCloud.Cms.Inputs.EventRuleEventPatternArgs
{
Product = "string",
EventTypeLists = new[]
{
"string",
},
LevelLists = new[]
{
"string",
},
NameLists = new[]
{
"string",
},
SqlFilter = "string",
},
RuleName = "string",
ContactParameters = new[]
{
new AliCloud.Cms.Inputs.EventRuleContactParameterArgs
{
ContactGroupName = "string",
ContactParametersId = "string",
Level = "string",
},
},
Description = "string",
FcParameters = new[]
{
new AliCloud.Cms.Inputs.EventRuleFcParameterArgs
{
Arn = "string",
FcParametersId = "string",
FunctionName = "string",
Region = "string",
ServiceName = "string",
},
},
GroupId = "string",
MnsParameters = new[]
{
new AliCloud.Cms.Inputs.EventRuleMnsParameterArgs
{
Arn = "string",
MnsParametersId = "string",
Queue = "string",
Region = "string",
Topic = "string",
},
},
OpenApiParameters = new[]
{
new AliCloud.Cms.Inputs.EventRuleOpenApiParameterArgs
{
Action = "string",
Arn = "string",
OpenApiParametersId = "string",
Product = "string",
Region = "string",
Role = "string",
Version = "string",
},
},
SilenceTime = 0,
SlsParameters = new[]
{
new AliCloud.Cms.Inputs.EventRuleSlsParameterArgs
{
Arn = "string",
LogStore = "string",
Project = "string",
Region = "string",
SlsParametersId = "string",
},
},
Status = "string",
WebhookParameters = new[]
{
new AliCloud.Cms.Inputs.EventRuleWebhookParameterArgs
{
Method = "string",
Protocol = "string",
Url = "string",
WebhookParametersId = "string",
},
},
});
example, err := cms.NewEventRule(ctx, "eventRuleResource", &cms.EventRuleArgs{
EventPattern: &cms.EventRuleEventPatternArgs{
Product: pulumi.String("string"),
EventTypeLists: pulumi.StringArray{
pulumi.String("string"),
},
LevelLists: pulumi.StringArray{
pulumi.String("string"),
},
NameLists: pulumi.StringArray{
pulumi.String("string"),
},
SqlFilter: pulumi.String("string"),
},
RuleName: pulumi.String("string"),
ContactParameters: cms.EventRuleContactParameterArray{
&cms.EventRuleContactParameterArgs{
ContactGroupName: pulumi.String("string"),
ContactParametersId: pulumi.String("string"),
Level: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
FcParameters: cms.EventRuleFcParameterArray{
&cms.EventRuleFcParameterArgs{
Arn: pulumi.String("string"),
FcParametersId: pulumi.String("string"),
FunctionName: pulumi.String("string"),
Region: pulumi.String("string"),
ServiceName: pulumi.String("string"),
},
},
GroupId: pulumi.String("string"),
MnsParameters: cms.EventRuleMnsParameterArray{
&cms.EventRuleMnsParameterArgs{
Arn: pulumi.String("string"),
MnsParametersId: pulumi.String("string"),
Queue: pulumi.String("string"),
Region: pulumi.String("string"),
Topic: pulumi.String("string"),
},
},
OpenApiParameters: cms.EventRuleOpenApiParameterArray{
&cms.EventRuleOpenApiParameterArgs{
Action: pulumi.String("string"),
Arn: pulumi.String("string"),
OpenApiParametersId: pulumi.String("string"),
Product: pulumi.String("string"),
Region: pulumi.String("string"),
Role: pulumi.String("string"),
Version: pulumi.String("string"),
},
},
SilenceTime: pulumi.Int(0),
SlsParameters: cms.EventRuleSlsParameterArray{
&cms.EventRuleSlsParameterArgs{
Arn: pulumi.String("string"),
LogStore: pulumi.String("string"),
Project: pulumi.String("string"),
Region: pulumi.String("string"),
SlsParametersId: pulumi.String("string"),
},
},
Status: pulumi.String("string"),
WebhookParameters: cms.EventRuleWebhookParameterArray{
&cms.EventRuleWebhookParameterArgs{
Method: pulumi.String("string"),
Protocol: pulumi.String("string"),
Url: pulumi.String("string"),
WebhookParametersId: pulumi.String("string"),
},
},
})
var eventRuleResource = new EventRule("eventRuleResource", EventRuleArgs.builder()
.eventPattern(EventRuleEventPatternArgs.builder()
.product("string")
.eventTypeLists("string")
.levelLists("string")
.nameLists("string")
.sqlFilter("string")
.build())
.ruleName("string")
.contactParameters(EventRuleContactParameterArgs.builder()
.contactGroupName("string")
.contactParametersId("string")
.level("string")
.build())
.description("string")
.fcParameters(EventRuleFcParameterArgs.builder()
.arn("string")
.fcParametersId("string")
.functionName("string")
.region("string")
.serviceName("string")
.build())
.groupId("string")
.mnsParameters(EventRuleMnsParameterArgs.builder()
.arn("string")
.mnsParametersId("string")
.queue("string")
.region("string")
.topic("string")
.build())
.openApiParameters(EventRuleOpenApiParameterArgs.builder()
.action("string")
.arn("string")
.openApiParametersId("string")
.product("string")
.region("string")
.role("string")
.version("string")
.build())
.silenceTime(0)
.slsParameters(EventRuleSlsParameterArgs.builder()
.arn("string")
.logStore("string")
.project("string")
.region("string")
.slsParametersId("string")
.build())
.status("string")
.webhookParameters(EventRuleWebhookParameterArgs.builder()
.method("string")
.protocol("string")
.url("string")
.webhookParametersId("string")
.build())
.build());
event_rule_resource = alicloud.cms.EventRule("eventRuleResource",
event_pattern=alicloud.cms.EventRuleEventPatternArgs(
product="string",
event_type_lists=["string"],
level_lists=["string"],
name_lists=["string"],
sql_filter="string",
),
rule_name="string",
contact_parameters=[alicloud.cms.EventRuleContactParameterArgs(
contact_group_name="string",
contact_parameters_id="string",
level="string",
)],
description="string",
fc_parameters=[alicloud.cms.EventRuleFcParameterArgs(
arn="string",
fc_parameters_id="string",
function_name="string",
region="string",
service_name="string",
)],
group_id="string",
mns_parameters=[alicloud.cms.EventRuleMnsParameterArgs(
arn="string",
mns_parameters_id="string",
queue="string",
region="string",
topic="string",
)],
open_api_parameters=[alicloud.cms.EventRuleOpenApiParameterArgs(
action="string",
arn="string",
open_api_parameters_id="string",
product="string",
region="string",
role="string",
version="string",
)],
silence_time=0,
sls_parameters=[alicloud.cms.EventRuleSlsParameterArgs(
arn="string",
log_store="string",
project="string",
region="string",
sls_parameters_id="string",
)],
status="string",
webhook_parameters=[alicloud.cms.EventRuleWebhookParameterArgs(
method="string",
protocol="string",
url="string",
webhook_parameters_id="string",
)])
const eventRuleResource = new alicloud.cms.EventRule("eventRuleResource", {
eventPattern: {
product: "string",
eventTypeLists: ["string"],
levelLists: ["string"],
nameLists: ["string"],
sqlFilter: "string",
},
ruleName: "string",
contactParameters: [{
contactGroupName: "string",
contactParametersId: "string",
level: "string",
}],
description: "string",
fcParameters: [{
arn: "string",
fcParametersId: "string",
functionName: "string",
region: "string",
serviceName: "string",
}],
groupId: "string",
mnsParameters: [{
arn: "string",
mnsParametersId: "string",
queue: "string",
region: "string",
topic: "string",
}],
openApiParameters: [{
action: "string",
arn: "string",
openApiParametersId: "string",
product: "string",
region: "string",
role: "string",
version: "string",
}],
silenceTime: 0,
slsParameters: [{
arn: "string",
logStore: "string",
project: "string",
region: "string",
slsParametersId: "string",
}],
status: "string",
webhookParameters: [{
method: "string",
protocol: "string",
url: "string",
webhookParametersId: "string",
}],
});
type: alicloud:cms:EventRule
properties:
contactParameters:
- contactGroupName: string
contactParametersId: string
level: string
description: string
eventPattern:
eventTypeLists:
- string
levelLists:
- string
nameLists:
- string
product: string
sqlFilter: string
fcParameters:
- arn: string
fcParametersId: string
functionName: string
region: string
serviceName: string
groupId: string
mnsParameters:
- arn: string
mnsParametersId: string
queue: string
region: string
topic: string
openApiParameters:
- action: string
arn: string
openApiParametersId: string
product: string
region: string
role: string
version: string
ruleName: string
silenceTime: 0
slsParameters:
- arn: string
logStore: string
project: string
region: string
slsParametersId: string
status: string
webhookParameters:
- method: string
protocol: string
url: string
webhookParametersId: string
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 - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - Rule
Name string - The name of the event-triggered alert rule.
- Contact
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Contact Parameter> - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - Description string
- The description of the event-triggered alert rule.
- Fc
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Fc Parameter> - The information about the recipients in Function Compute. See
fc_parameters
below. - Group
Id string - The ID of the application group to which the event-triggered alert rule belongs.
- Mns
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Mns Parameter> - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - Open
Api List<Pulumi.Parameters Ali Cloud. Cms. Inputs. Event Rule Open Api Parameter> - The parameters of API callback notification. See
open_api_parameters
below. - Silence
Time int - The silence time.
- Sls
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Sls Parameter> - The information about the recipients in Simple Log Service. See
sls_parameters
below. - Status string
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - Webhook
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Webhook Parameter> - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- Event
Pattern EventRule Event Pattern Args - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - Rule
Name string - The name of the event-triggered alert rule.
- Contact
Parameters []EventRule Contact Parameter Args - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - Description string
- The description of the event-triggered alert rule.
- Fc
Parameters []EventRule Fc Parameter Args - The information about the recipients in Function Compute. See
fc_parameters
below. - Group
Id string - The ID of the application group to which the event-triggered alert rule belongs.
- Mns
Parameters []EventRule Mns Parameter Args - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - Open
Api []EventParameters Rule Open Api Parameter Args - The parameters of API callback notification. See
open_api_parameters
below. - Silence
Time int - The silence time.
- Sls
Parameters []EventRule Sls Parameter Args - The information about the recipients in Simple Log Service. See
sls_parameters
below. - Status string
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - Webhook
Parameters []EventRule Webhook Parameter Args - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- event
Pattern EventRule Event Pattern - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - rule
Name String - The name of the event-triggered alert rule.
- contact
Parameters List<EventRule Contact Parameter> - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - description String
- The description of the event-triggered alert rule.
- fc
Parameters List<EventRule Fc Parameter> - The information about the recipients in Function Compute. See
fc_parameters
below. - group
Id String - The ID of the application group to which the event-triggered alert rule belongs.
- mns
Parameters List<EventRule Mns Parameter> - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open
Api List<EventParameters Rule Open Api Parameter> - The parameters of API callback notification. See
open_api_parameters
below. - silence
Time Integer - The silence time.
- sls
Parameters List<EventRule Sls Parameter> - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status String
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook
Parameters List<EventRule Webhook Parameter> - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- event
Pattern EventRule Event Pattern - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - rule
Name string - The name of the event-triggered alert rule.
- contact
Parameters EventRule Contact Parameter[] - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - description string
- The description of the event-triggered alert rule.
- fc
Parameters EventRule Fc Parameter[] - The information about the recipients in Function Compute. See
fc_parameters
below. - group
Id string - The ID of the application group to which the event-triggered alert rule belongs.
- mns
Parameters EventRule Mns Parameter[] - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open
Api EventParameters Rule Open Api Parameter[] - The parameters of API callback notification. See
open_api_parameters
below. - silence
Time number - The silence time.
- sls
Parameters EventRule Sls Parameter[] - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status string
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook
Parameters EventRule Webhook Parameter[] - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- event_
pattern EventRule Event Pattern Args - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - rule_
name str - The name of the event-triggered alert rule.
- contact_
parameters Sequence[EventRule Contact Parameter Args] - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - description str
- The description of the event-triggered alert rule.
- fc_
parameters Sequence[EventRule Fc Parameter Args] - The information about the recipients in Function Compute. See
fc_parameters
below. - group_
id str - The ID of the application group to which the event-triggered alert rule belongs.
- mns_
parameters Sequence[EventRule Mns Parameter Args] - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open_
api_ Sequence[Eventparameters Rule Open Api Parameter Args] - The parameters of API callback notification. See
open_api_parameters
below. - silence_
time int - The silence time.
- sls_
parameters Sequence[EventRule Sls Parameter Args] - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status str
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook_
parameters Sequence[EventRule Webhook Parameter Args] - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- event
Pattern Property Map - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - rule
Name String - The name of the event-triggered alert rule.
- contact
Parameters List<Property Map> - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - description String
- The description of the event-triggered alert rule.
- fc
Parameters List<Property Map> - The information about the recipients in Function Compute. See
fc_parameters
below. - group
Id String - The ID of the application group to which the event-triggered alert rule belongs.
- mns
Parameters List<Property Map> - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open
Api List<Property Map>Parameters - The parameters of API callback notification. See
open_api_parameters
below. - silence
Time Number - The silence time.
- sls
Parameters List<Property Map> - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status String
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook
Parameters List<Property Map> - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
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,
contact_parameters: Optional[Sequence[EventRuleContactParameterArgs]] = None,
description: Optional[str] = None,
event_pattern: Optional[EventRuleEventPatternArgs] = None,
fc_parameters: Optional[Sequence[EventRuleFcParameterArgs]] = None,
group_id: Optional[str] = None,
mns_parameters: Optional[Sequence[EventRuleMnsParameterArgs]] = None,
open_api_parameters: Optional[Sequence[EventRuleOpenApiParameterArgs]] = None,
rule_name: Optional[str] = None,
silence_time: Optional[int] = None,
sls_parameters: Optional[Sequence[EventRuleSlsParameterArgs]] = None,
status: Optional[str] = None,
webhook_parameters: Optional[Sequence[EventRuleWebhookParameterArgs]] = 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.
- Contact
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Contact Parameter> - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - Description string
- The description of the event-triggered alert rule.
- Event
Pattern Pulumi.Ali Cloud. Cms. Inputs. Event Rule Event Pattern - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - Fc
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Fc Parameter> - The information about the recipients in Function Compute. See
fc_parameters
below. - Group
Id string - The ID of the application group to which the event-triggered alert rule belongs.
- Mns
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Mns Parameter> - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - Open
Api List<Pulumi.Parameters Ali Cloud. Cms. Inputs. Event Rule Open Api Parameter> - The parameters of API callback notification. See
open_api_parameters
below. - Rule
Name string - The name of the event-triggered alert rule.
- Silence
Time int - The silence time.
- Sls
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Sls Parameter> - The information about the recipients in Simple Log Service. See
sls_parameters
below. - Status string
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - Webhook
Parameters List<Pulumi.Ali Cloud. Cms. Inputs. Event Rule Webhook Parameter> - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- Contact
Parameters []EventRule Contact Parameter Args - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - 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
event_pattern
below. - Fc
Parameters []EventRule Fc Parameter Args - The information about the recipients in Function Compute. See
fc_parameters
below. - Group
Id string - The ID of the application group to which the event-triggered alert rule belongs.
- Mns
Parameters []EventRule Mns Parameter Args - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - Open
Api []EventParameters Rule Open Api Parameter Args - The parameters of API callback notification. See
open_api_parameters
below. - Rule
Name string - The name of the event-triggered alert rule.
- Silence
Time int - The silence time.
- Sls
Parameters []EventRule Sls Parameter Args - The information about the recipients in Simple Log Service. See
sls_parameters
below. - Status string
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - Webhook
Parameters []EventRule Webhook Parameter Args - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- contact
Parameters List<EventRule Contact Parameter> - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - description String
- The description of the event-triggered alert rule.
- event
Pattern EventRule Event Pattern - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - fc
Parameters List<EventRule Fc Parameter> - The information about the recipients in Function Compute. See
fc_parameters
below. - group
Id String - The ID of the application group to which the event-triggered alert rule belongs.
- mns
Parameters List<EventRule Mns Parameter> - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open
Api List<EventParameters Rule Open Api Parameter> - The parameters of API callback notification. See
open_api_parameters
below. - rule
Name String - The name of the event-triggered alert rule.
- silence
Time Integer - The silence time.
- sls
Parameters List<EventRule Sls Parameter> - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status String
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook
Parameters List<EventRule Webhook Parameter> - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- contact
Parameters EventRule Contact Parameter[] - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - description string
- The description of the event-triggered alert rule.
- event
Pattern EventRule Event Pattern - Event mode, used to describe the trigger conditions for this event. See
event_pattern
below. - fc
Parameters EventRule Fc Parameter[] - The information about the recipients in Function Compute. See
fc_parameters
below. - group
Id string - The ID of the application group to which the event-triggered alert rule belongs.
- mns
Parameters EventRule Mns Parameter[] - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open
Api EventParameters Rule Open Api Parameter[] - The parameters of API callback notification. See
open_api_parameters
below. - rule
Name string - The name of the event-triggered alert rule.
- silence
Time number - The silence time.
- sls
Parameters EventRule Sls Parameter[] - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status string
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook
Parameters EventRule Webhook Parameter[] - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- contact_
parameters Sequence[EventRule Contact Parameter Args] - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - 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
event_pattern
below. - fc_
parameters Sequence[EventRule Fc Parameter Args] - The information about the recipients in Function Compute. See
fc_parameters
below. - group_
id str - The ID of the application group to which the event-triggered alert rule belongs.
- mns_
parameters Sequence[EventRule Mns Parameter Args] - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open_
api_ Sequence[Eventparameters Rule Open Api Parameter Args] - The parameters of API callback notification. See
open_api_parameters
below. - rule_
name str - The name of the event-triggered alert rule.
- silence_
time int - The silence time.
- sls_
parameters Sequence[EventRule Sls Parameter Args] - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status str
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook_
parameters Sequence[EventRule Webhook Parameter Args] - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
- contact
Parameters List<Property Map> - The information about the alert contact groups that receive alert notifications. See
contact_parameters
below. - 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
event_pattern
below. - fc
Parameters List<Property Map> - The information about the recipients in Function Compute. See
fc_parameters
below. - group
Id String - The ID of the application group to which the event-triggered alert rule belongs.
- mns
Parameters List<Property Map> - The information about the recipients in Message Service (MNS). See
mns_parameters
below. - open
Api List<Property Map>Parameters - The parameters of API callback notification. See
open_api_parameters
below. - rule
Name String - The name of the event-triggered alert rule.
- silence
Time Number - The silence time.
- sls
Parameters List<Property Map> - The information about the recipients in Simple Log Service. See
sls_parameters
below. - status String
- The status of the resource. Valid values:
ENABLED
,DISABLED
. - webhook
Parameters List<Property Map> - The information about the callback URLs that are used to receive alert notifications. See
webhook_parameters
below.
Supporting Types
EventRuleContactParameter, EventRuleContactParameterArgs
- Contact
Group stringName - The name of the alert contact group.
- Contact
Parameters stringId - The ID of the recipient that receives alert notifications.
- Level string
- The alert level and the corresponding notification methods.
- Contact
Group stringName - The name of the alert contact group.
- Contact
Parameters stringId - The ID of the recipient that receives alert notifications.
- Level string
- The alert level and the corresponding notification methods.
- contact
Group StringName - The name of the alert contact group.
- contact
Parameters StringId - The ID of the recipient that receives alert notifications.
- level String
- The alert level and the corresponding notification methods.
- contact
Group stringName - The name of the alert contact group.
- contact
Parameters stringId - The ID of the recipient that receives alert notifications.
- level string
- The alert level and the corresponding notification methods.
- contact_
group_ strname - The name of the alert contact group.
- contact_
parameters_ strid - The ID of the recipient that receives alert notifications.
- level str
- The alert level and the corresponding notification methods.
- contact
Group StringName - The name of the alert contact group.
- contact
Parameters StringId - The ID of the recipient that receives alert notifications.
- level String
- The alert level and the corresponding notification methods.
EventRuleEventPattern, EventRuleEventPatternArgs
- Product string
- The type of the cloud service.
- Event
Type List<string>Lists - The type of the event-triggered alert rule. Valid values:
StatusNotification
: fault notifications.Exception
: exceptions.Maintenance
: O&M.*
: all types.
- Level
Lists List<string> - The level of the event-triggered alert rule. Valid values:
CRITICAL
: critical.WARN
: warning.INFO
: information.*
: all types.
- 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:
StatusNotification
: fault notifications.Exception
: exceptions.Maintenance
: O&M.*
: all types.
- Level
Lists []string - The level of the event-triggered alert rule. Valid values:
CRITICAL
: critical.WARN
: warning.INFO
: information.*
: all types.
- 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:
StatusNotification
: fault notifications.Exception
: exceptions.Maintenance
: O&M.*
: all types.
- level
Lists List<String> - The level of the event-triggered alert rule. Valid values:
CRITICAL
: critical.WARN
: warning.INFO
: information.*
: all types.
- 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:
StatusNotification
: fault notifications.Exception
: exceptions.Maintenance
: O&M.*
: all types.
- level
Lists string[] - The level of the event-triggered alert rule. Valid values:
CRITICAL
: critical.WARN
: warning.INFO
: information.*
: all types.
- 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:
StatusNotification
: fault notifications.Exception
: exceptions.Maintenance
: O&M.*
: all types.
- level_
lists Sequence[str] - The level of the event-triggered alert rule. Valid values:
CRITICAL
: critical.WARN
: warning.INFO
: information.*
: all types.
- 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:
StatusNotification
: fault notifications.Exception
: exceptions.Maintenance
: O&M.*
: all types.
- level
Lists List<String> - The level of the event-triggered alert rule. Valid values:
CRITICAL
: critical.WARN
: warning.INFO
: information.*
: all types.
- 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.
EventRuleFcParameter, EventRuleFcParameterArgs
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Fc
Parameters stringId - The ID of the recipient that receives alert notifications.
- Function
Name string - The name of the function.
- Region string
- The region where Function Compute is deployed.
- Service
Name string - The name of the Function Compute service.
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Fc
Parameters stringId - The ID of the recipient that receives alert notifications.
- Function
Name string - The name of the function.
- Region string
- The region where Function Compute is deployed.
- Service
Name string - The name of the Function Compute service.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- fc
Parameters StringId - The ID of the recipient that receives alert notifications.
- function
Name String - The name of the function.
- region String
- The region where Function Compute is deployed.
- service
Name String - The name of the Function Compute service.
- arn string
- (Available since v1.211.1) The ARN of the API operation.
- fc
Parameters stringId - The ID of the recipient that receives alert notifications.
- function
Name string - The name of the function.
- region string
- The region where Function Compute is deployed.
- service
Name string - The name of the Function Compute service.
- arn str
- (Available since v1.211.1) The ARN of the API operation.
- fc_
parameters_ strid - The ID of the recipient that receives alert notifications.
- function_
name str - The name of the function.
- region str
- The region where Function Compute is deployed.
- service_
name str - The name of the Function Compute service.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- fc
Parameters StringId - The ID of the recipient that receives alert notifications.
- function
Name String - The name of the function.
- region String
- The region where Function Compute is deployed.
- service
Name String - The name of the Function Compute service.
EventRuleMnsParameter, EventRuleMnsParameterArgs
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Mns
Parameters stringId - The ID of the recipient that receives alert notifications.
- Queue string
- The name of the MNS queue.
- Region string
- The region where Message Service (MNS) is deployed.
- Topic string
- The MNS topic.
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Mns
Parameters stringId - The ID of the recipient that receives alert notifications.
- Queue string
- The name of the MNS queue.
- Region string
- The region where Message Service (MNS) is deployed.
- Topic string
- The MNS topic.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- mns
Parameters StringId - The ID of the recipient that receives alert notifications.
- queue String
- The name of the MNS queue.
- region String
- The region where Message Service (MNS) is deployed.
- topic String
- The MNS topic.
- arn string
- (Available since v1.211.1) The ARN of the API operation.
- mns
Parameters stringId - The ID of the recipient that receives alert notifications.
- queue string
- The name of the MNS queue.
- region string
- The region where Message Service (MNS) is deployed.
- topic string
- The MNS topic.
- arn str
- (Available since v1.211.1) The ARN of the API operation.
- mns_
parameters_ strid - The ID of the recipient that receives alert notifications.
- queue str
- The name of the MNS queue.
- region str
- The region where Message Service (MNS) is deployed.
- topic str
- The MNS topic.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- mns
Parameters StringId - The ID of the recipient that receives alert notifications.
- queue String
- The name of the MNS queue.
- region String
- The region where Message Service (MNS) is deployed.
- topic String
- The MNS topic.
EventRuleOpenApiParameter, EventRuleOpenApiParameterArgs
- Action string
- The API name.
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Open
Api stringParameters Id - The ID of the recipient that receives alert notifications sent by an API callback.
- Product string
- The ID of the cloud service to which the API operation belongs.
- Region string
- The region where the resource resides.
- Role string
- The name of the role.
- Version string
- The version of the API.
- Action string
- The API name.
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Open
Api stringParameters Id - The ID of the recipient that receives alert notifications sent by an API callback.
- Product string
- The ID of the cloud service to which the API operation belongs.
- Region string
- The region where the resource resides.
- Role string
- The name of the role.
- Version string
- The version of the API.
- action String
- The API name.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- open
Api StringParameters Id - The ID of the recipient that receives alert notifications sent by an API callback.
- product String
- The ID of the cloud service to which the API operation belongs.
- region String
- The region where the resource resides.
- role String
- The name of the role.
- version String
- The version of the API.
- action string
- The API name.
- arn string
- (Available since v1.211.1) The ARN of the API operation.
- open
Api stringParameters Id - The ID of the recipient that receives alert notifications sent by an API callback.
- product string
- The ID of the cloud service to which the API operation belongs.
- region string
- The region where the resource resides.
- role string
- The name of the role.
- version string
- The version of the API.
- action str
- The API name.
- arn str
- (Available since v1.211.1) The ARN of the API operation.
- open_
api_ strparameters_ id - The ID of the recipient that receives alert notifications sent by an API callback.
- product str
- The ID of the cloud service to which the API operation belongs.
- region str
- The region where the resource resides.
- role str
- The name of the role.
- version str
- The version of the API.
- action String
- The API name.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- open
Api StringParameters Id - The ID of the recipient that receives alert notifications sent by an API callback.
- product String
- The ID of the cloud service to which the API operation belongs.
- region String
- The region where the resource resides.
- role String
- The name of the role.
- version String
- The version of the API.
EventRuleSlsParameter, EventRuleSlsParameterArgs
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Log
Store string - The name of the Simple Log Service Logstore.
- Project string
- The name of the Simple Log Service project.
- Region string
- The region where Simple Log Service is deployed.
- Sls
Parameters stringId - The ID of the recipient that receives alert notifications.
- Arn string
- (Available since v1.211.1) The ARN of the API operation.
- Log
Store string - The name of the Simple Log Service Logstore.
- Project string
- The name of the Simple Log Service project.
- Region string
- The region where Simple Log Service is deployed.
- Sls
Parameters stringId - The ID of the recipient that receives alert notifications.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- log
Store String - The name of the Simple Log Service Logstore.
- project String
- The name of the Simple Log Service project.
- region String
- The region where Simple Log Service is deployed.
- sls
Parameters StringId - The ID of the recipient that receives alert notifications.
- arn string
- (Available since v1.211.1) The ARN of the API operation.
- log
Store string - The name of the Simple Log Service Logstore.
- project string
- The name of the Simple Log Service project.
- region string
- The region where Simple Log Service is deployed.
- sls
Parameters stringId - The ID of the recipient that receives alert notifications.
- arn str
- (Available since v1.211.1) The ARN of the API operation.
- log_
store str - The name of the Simple Log Service Logstore.
- project str
- The name of the Simple Log Service project.
- region str
- The region where Simple Log Service is deployed.
- sls_
parameters_ strid - The ID of the recipient that receives alert notifications.
- arn String
- (Available since v1.211.1) The ARN of the API operation.
- log
Store String - The name of the Simple Log Service Logstore.
- project String
- The name of the Simple Log Service project.
- region String
- The region where Simple Log Service is deployed.
- sls
Parameters StringId - The ID of the recipient that receives alert notifications.
EventRuleWebhookParameter, EventRuleWebhookParameterArgs
- Method string
- The HTTP request method.
- Protocol string
- The name of the protocol.
- Url string
- The callback URL.
- Webhook
Parameters stringId - The ID of the recipient that receives alert notifications.
- Method string
- The HTTP request method.
- Protocol string
- The name of the protocol.
- Url string
- The callback URL.
- Webhook
Parameters stringId - The ID of the recipient that receives alert notifications.
- method String
- The HTTP request method.
- protocol String
- The name of the protocol.
- url String
- The callback URL.
- webhook
Parameters StringId - The ID of the recipient that receives alert notifications.
- method string
- The HTTP request method.
- protocol string
- The name of the protocol.
- url string
- The callback URL.
- webhook
Parameters stringId - The ID of the recipient that receives alert notifications.
- method str
- The HTTP request method.
- protocol str
- The name of the protocol.
- url str
- The callback URL.
- webhook_
parameters_ strid - The ID of the recipient that receives alert notifications.
- method String
- The HTTP request method.
- protocol String
- The name of the protocol.
- url String
- The callback URL.
- webhook
Parameters StringId - The ID of the recipient that receives alert notifications.
Import
Cloud Monitor Service Event Rule can be imported using the id, e.g.
$ pulumi import alicloud:cms/eventRule:EventRule example <rule_name>
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.