EventRuleArgs

data class EventRuleArgs(val description: Output<String>? = null, val eventPattern: Output<EventRuleEventPatternArgs>? = null, val groupId: Output<String>? = null, val ruleName: Output<String>? = null, val silenceTime: Output<Int>? = null, val status: Output<String>? = null) : ConvertibleToJava<EventRuleArgs>

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

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())
.description(name)
.status("ENABLED")
.eventPattern(EventRuleEventPatternArgs.builder()
.product("ecs")
.eventTypeLists("StatusNotification")
.levelLists("CRITICAL")
.nameLists("example_value")
.sqlFilter("example_value")
.build())
.silenceTime(100)
.build());
}
}

Import

Cloud Monitor Service Event Rule can be imported using the id, e.g.

$ pulumi import alicloud:cms/eventRule:EventRule example <rule_name>

Constructors

Link copied to clipboard
fun EventRuleArgs(description: Output<String>? = null, eventPattern: Output<EventRuleEventPatternArgs>? = null, groupId: Output<String>? = null, ruleName: Output<String>? = null, silenceTime: Output<Int>? = null, status: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): EventRuleArgs

Properties

Link copied to clipboard
val description: Output<String>? = null

The description of the event-triggered alert rule.

Link copied to clipboard

Event mode, used to describe the trigger conditions for this event. See event_pattern below.

Link copied to clipboard
val groupId: Output<String>? = null

The ID of the application group to which the event-triggered alert rule belongs.

Link copied to clipboard
val ruleName: Output<String>? = null

The name of the event-triggered alert rule.

Link copied to clipboard
val silenceTime: Output<Int>? = null

The silence time.

Link copied to clipboard
val status: Output<String>? = null

The status of the resource. Valid values: ENABLED, DISABLED.