Rule

class Rule : KotlinCustomResource

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>

Properties

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

The description of rule.

Link copied to clipboard
val eventBusName: Output<String>

The name of event bus.

Link copied to clipboard
val filterPattern: Output<String>

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 id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ruleName: Output<String>

The name of rule.

Link copied to clipboard
val status: Output<String>

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

Link copied to clipboard
val targets: Output<List<RuleTarget>>

The target of rule. See targets below.

Link copied to clipboard
val urn: Output<String>