RuleArgs

data class RuleArgs(val description: Output<String>? = null, val eventBusName: Output<String>? = null, val filterPattern: Output<String>? = null, val ruleName: Output<String>? = null, val status: Output<String>? = null, val targets: Output<List<RuleTargetArgs>>? = null) : ConvertibleToJava<RuleArgs>

Provides a Event Bridge Rule resource. For information about Event Bridge Rule and how to use it, see What is Rule.

NOTE: Available since v1.129.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.eventbridge.EventBus;
import com.pulumi.alicloud.eventbridge.EventBusArgs;
import com.pulumi.alicloud.eventbridge.Rule;
import com.pulumi.alicloud.eventbridge.RuleArgs;
import com.pulumi.alicloud.eventbridge.inputs.RuleTargetArgs;
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 exampleEventBus = new EventBus("exampleEventBus", EventBusArgs.builder()
.eventBusName("example_value")
.build());
var exampleRule = new Rule("exampleRule", RuleArgs.builder()
.eventBusName(exampleEventBus.id())
.ruleName(var_.name())
.description("test")
.filterPattern("{\"source\":[\"crmabc.newsletter\"],\"type\":[\"UserSignUp\", \"UserLogin\"]}")
.targets(RuleTargetArgs.builder()
.targetId("tf-test")
.endpoint("acs:mns:cn-hangzhou:118938335****:queues/tf-test")
.type("acs.mns.queue")
.paramLists(
RuleTargetParamListArgs.builder()
.resourceKey("queue")
.form("CONSTANT")
.value("tf-testaccEbRule")
.build(),
RuleTargetParamListArgs.builder()
.resourceKey("Body")
.form("ORIGINAL")
.build())
.build())
.build());
}
}

Import

Event Bridge Rule can be imported using the id, e.g.

$ pulumi import alicloud:eventbridge/rule:Rule example <event_bus_name>:<rule_name>

Constructors

Link copied to clipboard
fun RuleArgs(description: Output<String>? = null, eventBusName: Output<String>? = null, filterPattern: Output<String>? = null, ruleName: Output<String>? = null, status: Output<String>? = null, targets: Output<List<RuleTargetArgs>>? = null)

Functions

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

Properties

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

The description of rule.

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

The name of event bus.

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

The pattern to match interested events. Event mode, JSON format. The value description is as follows: stringEqual mode. stringExpression mode. Each field has up to 5 expressions (map structure).

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

The name of rule.

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

Rule status, either Enable or Disable. Valid values: DISABLE, ENABLE.

Link copied to clipboard
val targets: Output<List<RuleTargetArgs>>? = null

The target of rule. See targets below.