1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getEbEventRules
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getEbEventRules

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of eb event_rules

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.EbEventBus("foo", {
        eventBusName: "tf-event_bus_rule",
        description: "event bus desc",
        enableStore: false,
        saveDays: 1,
        tags: {
            createdBy: "terraform",
        },
    });
    const eventRule = new tencentcloud.EbEventRule("eventRule", {
        eventBusId: foo.ebEventBusId,
        ruleName: "tf-event_rule",
        description: "event rule desc",
        enable: true,
        eventPattern: JSON.stringify({
            source: "apigw.cloud.tencent",
            type: ["connector:apigw"],
        }),
        tags: {
            createdBy: "terraform",
        },
    });
    const eventRules = tencentcloud.getEbEventRulesOutput({
        eventBusId: foo.ebEventBusId,
        orderBy: "AddTime",
        order: "DESC",
    });
    
    import pulumi
    import json
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.EbEventBus("foo",
        event_bus_name="tf-event_bus_rule",
        description="event bus desc",
        enable_store=False,
        save_days=1,
        tags={
            "createdBy": "terraform",
        })
    event_rule = tencentcloud.EbEventRule("eventRule",
        event_bus_id=foo.eb_event_bus_id,
        rule_name="tf-event_rule",
        description="event rule desc",
        enable=True,
        event_pattern=json.dumps({
            "source": "apigw.cloud.tencent",
            "type": ["connector:apigw"],
        }),
        tags={
            "createdBy": "terraform",
        })
    event_rules = tencentcloud.get_eb_event_rules_output(event_bus_id=foo.eb_event_bus_id,
        order_by="AddTime",
        order="DESC")
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := tencentcloud.NewEbEventBus(ctx, "foo", &tencentcloud.EbEventBusArgs{
    			EventBusName: pulumi.String("tf-event_bus_rule"),
    			Description:  pulumi.String("event bus desc"),
    			EnableStore:  pulumi.Bool(false),
    			SaveDays:     pulumi.Float64(1),
    			Tags: pulumi.StringMap{
    				"createdBy": pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"source": "apigw.cloud.tencent",
    			"type": []string{
    				"connector:apigw",
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = tencentcloud.NewEbEventRule(ctx, "eventRule", &tencentcloud.EbEventRuleArgs{
    			EventBusId:   foo.EbEventBusId,
    			RuleName:     pulumi.String("tf-event_rule"),
    			Description:  pulumi.String("event rule desc"),
    			Enable:       pulumi.Bool(true),
    			EventPattern: pulumi.String(json0),
    			Tags: pulumi.StringMap{
    				"createdBy": pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_ = tencentcloud.GetEbEventRulesOutput(ctx, tencentcloud.GetEbEventRulesOutputArgs{
    			EventBusId: foo.EbEventBusId,
    			OrderBy:    pulumi.String("AddTime"),
    			Order:      pulumi.String("DESC"),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Tencentcloud.EbEventBus("foo", new()
        {
            EventBusName = "tf-event_bus_rule",
            Description = "event bus desc",
            EnableStore = false,
            SaveDays = 1,
            Tags = 
            {
                { "createdBy", "terraform" },
            },
        });
    
        var eventRule = new Tencentcloud.EbEventRule("eventRule", new()
        {
            EventBusId = foo.EbEventBusId,
            RuleName = "tf-event_rule",
            Description = "event rule desc",
            Enable = true,
            EventPattern = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["source"] = "apigw.cloud.tencent",
                ["type"] = new[]
                {
                    "connector:apigw",
                },
            }),
            Tags = 
            {
                { "createdBy", "terraform" },
            },
        });
    
        var eventRules = Tencentcloud.GetEbEventRules.Invoke(new()
        {
            EventBusId = foo.EbEventBusId,
            OrderBy = "AddTime",
            Order = "DESC",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.EbEventBus;
    import com.pulumi.tencentcloud.EbEventBusArgs;
    import com.pulumi.tencentcloud.EbEventRule;
    import com.pulumi.tencentcloud.EbEventRuleArgs;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetEbEventRulesArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 foo = new EbEventBus("foo", EbEventBusArgs.builder()
                .eventBusName("tf-event_bus_rule")
                .description("event bus desc")
                .enableStore(false)
                .saveDays(1)
                .tags(Map.of("createdBy", "terraform"))
                .build());
    
            var eventRule = new EbEventRule("eventRule", EbEventRuleArgs.builder()
                .eventBusId(foo.ebEventBusId())
                .ruleName("tf-event_rule")
                .description("event rule desc")
                .enable(true)
                .eventPattern(serializeJson(
                    jsonObject(
                        jsonProperty("source", "apigw.cloud.tencent"),
                        jsonProperty("type", jsonArray("connector:apigw"))
                    )))
                .tags(Map.of("createdBy", "terraform"))
                .build());
    
            final var eventRules = TencentcloudFunctions.getEbEventRules(GetEbEventRulesArgs.builder()
                .eventBusId(foo.ebEventBusId())
                .orderBy("AddTime")
                .order("DESC")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:EbEventBus
        properties:
          eventBusName: tf-event_bus_rule
          description: event bus desc
          enableStore: false
          saveDays: 1
          tags:
            createdBy: terraform
      eventRule:
        type: tencentcloud:EbEventRule
        properties:
          eventBusId: ${foo.ebEventBusId}
          ruleName: tf-event_rule
          description: event rule desc
          enable: true
          eventPattern:
            fn::toJSON:
              source: apigw.cloud.tencent
              type:
                - connector:apigw
          tags:
            createdBy: terraform
    variables:
      eventRules:
        fn::invoke:
          function: tencentcloud:getEbEventRules
          arguments:
            eventBusId: ${foo.ebEventBusId}
            orderBy: AddTime
            order: DESC
    

    Using getEbEventRules

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getEbEventRules(args: GetEbEventRulesArgs, opts?: InvokeOptions): Promise<GetEbEventRulesResult>
    function getEbEventRulesOutput(args: GetEbEventRulesOutputArgs, opts?: InvokeOptions): Output<GetEbEventRulesResult>
    def get_eb_event_rules(event_bus_id: Optional[str] = None,
                           id: Optional[str] = None,
                           order: Optional[str] = None,
                           order_by: Optional[str] = None,
                           result_output_file: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetEbEventRulesResult
    def get_eb_event_rules_output(event_bus_id: Optional[pulumi.Input[str]] = None,
                           id: Optional[pulumi.Input[str]] = None,
                           order: Optional[pulumi.Input[str]] = None,
                           order_by: Optional[pulumi.Input[str]] = None,
                           result_output_file: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetEbEventRulesResult]
    func GetEbEventRules(ctx *Context, args *GetEbEventRulesArgs, opts ...InvokeOption) (*GetEbEventRulesResult, error)
    func GetEbEventRulesOutput(ctx *Context, args *GetEbEventRulesOutputArgs, opts ...InvokeOption) GetEbEventRulesResultOutput

    > Note: This function is named GetEbEventRules in the Go SDK.

    public static class GetEbEventRules 
    {
        public static Task<GetEbEventRulesResult> InvokeAsync(GetEbEventRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetEbEventRulesResult> Invoke(GetEbEventRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEbEventRulesResult> getEbEventRules(GetEbEventRulesArgs args, InvokeOptions options)
    public static Output<GetEbEventRulesResult> getEbEventRules(GetEbEventRulesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getEbEventRules:getEbEventRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EventBusId string
    event bus Id.
    Id string
    Order string
    Return results in ascending or descending order, optional values ASC (ascending) and DESC (descending).
    OrderBy string
    According to which field to sort the returned results, the following fields are supported: AddTime (creation time), ModTime (modification time).
    ResultOutputFile string
    Used to save results.
    EventBusId string
    event bus Id.
    Id string
    Order string
    Return results in ascending or descending order, optional values ASC (ascending) and DESC (descending).
    OrderBy string
    According to which field to sort the returned results, the following fields are supported: AddTime (creation time), ModTime (modification time).
    ResultOutputFile string
    Used to save results.
    eventBusId String
    event bus Id.
    id String
    order String
    Return results in ascending or descending order, optional values ASC (ascending) and DESC (descending).
    orderBy String
    According to which field to sort the returned results, the following fields are supported: AddTime (creation time), ModTime (modification time).
    resultOutputFile String
    Used to save results.
    eventBusId string
    event bus Id.
    id string
    order string
    Return results in ascending or descending order, optional values ASC (ascending) and DESC (descending).
    orderBy string
    According to which field to sort the returned results, the following fields are supported: AddTime (creation time), ModTime (modification time).
    resultOutputFile string
    Used to save results.
    event_bus_id str
    event bus Id.
    id str
    order str
    Return results in ascending or descending order, optional values ASC (ascending) and DESC (descending).
    order_by str
    According to which field to sort the returned results, the following fields are supported: AddTime (creation time), ModTime (modification time).
    result_output_file str
    Used to save results.
    eventBusId String
    event bus Id.
    id String
    order String
    Return results in ascending or descending order, optional values ASC (ascending) and DESC (descending).
    orderBy String
    According to which field to sort the returned results, the following fields are supported: AddTime (creation time), ModTime (modification time).
    resultOutputFile String
    Used to save results.

    getEbEventRules Result

    The following output properties are available:

    EventBusId string
    event bus Id.
    Id string
    Rules List<GetEbEventRulesRule>
    Event rule information.
    Order string
    OrderBy string
    ResultOutputFile string
    EventBusId string
    event bus Id.
    Id string
    Rules []GetEbEventRulesRule
    Event rule information.
    Order string
    OrderBy string
    ResultOutputFile string
    eventBusId String
    event bus Id.
    id String
    rules List<GetEbEventRulesRule>
    Event rule information.
    order String
    orderBy String
    resultOutputFile String
    eventBusId string
    event bus Id.
    id string
    rules GetEbEventRulesRule[]
    Event rule information.
    order string
    orderBy string
    resultOutputFile string
    event_bus_id str
    event bus Id.
    id str
    rules Sequence[GetEbEventRulesRule]
    Event rule information.
    order str
    order_by str
    result_output_file str
    eventBusId String
    event bus Id.
    id String
    rules List<Property Map>
    Event rule information.
    order String
    orderBy String
    resultOutputFile String

    Supporting Types

    GetEbEventRulesRule

    AddTime string
    create time.
    DeadLetterConfigs List<GetEbEventRulesRuleDeadLetterConfig>
    The dlq rule set by rule. It may be null. Note: this field may return null, indicating that no valid value can be obtained.
    Description string
    description.
    Enable bool
    enable switch.
    EventBusId string
    event bus Id.
    ModTime string
    modify time.
    RuleId string
    rule Id.
    RuleName string
    rule name.
    Status string
    Status.
    Targets List<GetEbEventRulesRuleTarget>
    Target brief information, note: this field may return null, indicating that no valid value can be obtained.
    AddTime string
    create time.
    DeadLetterConfigs []GetEbEventRulesRuleDeadLetterConfig
    The dlq rule set by rule. It may be null. Note: this field may return null, indicating that no valid value can be obtained.
    Description string
    description.
    Enable bool
    enable switch.
    EventBusId string
    event bus Id.
    ModTime string
    modify time.
    RuleId string
    rule Id.
    RuleName string
    rule name.
    Status string
    Status.
    Targets []GetEbEventRulesRuleTarget
    Target brief information, note: this field may return null, indicating that no valid value can be obtained.
    addTime String
    create time.
    deadLetterConfigs List<GetEbEventRulesRuleDeadLetterConfig>
    The dlq rule set by rule. It may be null. Note: this field may return null, indicating that no valid value can be obtained.
    description String
    description.
    enable Boolean
    enable switch.
    eventBusId String
    event bus Id.
    modTime String
    modify time.
    ruleId String
    rule Id.
    ruleName String
    rule name.
    status String
    Status.
    targets List<GetEbEventRulesRuleTarget>
    Target brief information, note: this field may return null, indicating that no valid value can be obtained.
    addTime string
    create time.
    deadLetterConfigs GetEbEventRulesRuleDeadLetterConfig[]
    The dlq rule set by rule. It may be null. Note: this field may return null, indicating that no valid value can be obtained.
    description string
    description.
    enable boolean
    enable switch.
    eventBusId string
    event bus Id.
    modTime string
    modify time.
    ruleId string
    rule Id.
    ruleName string
    rule name.
    status string
    Status.
    targets GetEbEventRulesRuleTarget[]
    Target brief information, note: this field may return null, indicating that no valid value can be obtained.
    add_time str
    create time.
    dead_letter_configs Sequence[GetEbEventRulesRuleDeadLetterConfig]
    The dlq rule set by rule. It may be null. Note: this field may return null, indicating that no valid value can be obtained.
    description str
    description.
    enable bool
    enable switch.
    event_bus_id str
    event bus Id.
    mod_time str
    modify time.
    rule_id str
    rule Id.
    rule_name str
    rule name.
    status str
    Status.
    targets Sequence[GetEbEventRulesRuleTarget]
    Target brief information, note: this field may return null, indicating that no valid value can be obtained.
    addTime String
    create time.
    deadLetterConfigs List<Property Map>
    The dlq rule set by rule. It may be null. Note: this field may return null, indicating that no valid value can be obtained.
    description String
    description.
    enable Boolean
    enable switch.
    eventBusId String
    event bus Id.
    modTime String
    modify time.
    ruleId String
    rule Id.
    ruleName String
    rule name.
    status String
    Status.
    targets List<Property Map>
    Target brief information, note: this field may return null, indicating that no valid value can be obtained.

    GetEbEventRulesRuleDeadLetterConfig

    CkafkaDeliveryParams List<GetEbEventRulesRuleDeadLetterConfigCkafkaDeliveryParam>
    After setting the DLQ mode, this option is required. The error message will be delivered to the corresponding kafka topic Note: This field may return null, indicating that no valid value can be obtained.
    DisposeMethod string
    Support three modes of dlq, discarding, ignoring errors and continuing to pass, corresponding to: DLQ, DROP, IGNORE_ERROR.
    CkafkaDeliveryParams []GetEbEventRulesRuleDeadLetterConfigCkafkaDeliveryParam
    After setting the DLQ mode, this option is required. The error message will be delivered to the corresponding kafka topic Note: This field may return null, indicating that no valid value can be obtained.
    DisposeMethod string
    Support three modes of dlq, discarding, ignoring errors and continuing to pass, corresponding to: DLQ, DROP, IGNORE_ERROR.
    ckafkaDeliveryParams List<GetEbEventRulesRuleDeadLetterConfigCkafkaDeliveryParam>
    After setting the DLQ mode, this option is required. The error message will be delivered to the corresponding kafka topic Note: This field may return null, indicating that no valid value can be obtained.
    disposeMethod String
    Support three modes of dlq, discarding, ignoring errors and continuing to pass, corresponding to: DLQ, DROP, IGNORE_ERROR.
    ckafkaDeliveryParams GetEbEventRulesRuleDeadLetterConfigCkafkaDeliveryParam[]
    After setting the DLQ mode, this option is required. The error message will be delivered to the corresponding kafka topic Note: This field may return null, indicating that no valid value can be obtained.
    disposeMethod string
    Support three modes of dlq, discarding, ignoring errors and continuing to pass, corresponding to: DLQ, DROP, IGNORE_ERROR.
    ckafka_delivery_params Sequence[GetEbEventRulesRuleDeadLetterConfigCkafkaDeliveryParam]
    After setting the DLQ mode, this option is required. The error message will be delivered to the corresponding kafka topic Note: This field may return null, indicating that no valid value can be obtained.
    dispose_method str
    Support three modes of dlq, discarding, ignoring errors and continuing to pass, corresponding to: DLQ, DROP, IGNORE_ERROR.
    ckafkaDeliveryParams List<Property Map>
    After setting the DLQ mode, this option is required. The error message will be delivered to the corresponding kafka topic Note: This field may return null, indicating that no valid value can be obtained.
    disposeMethod String
    Support three modes of dlq, discarding, ignoring errors and continuing to pass, corresponding to: DLQ, DROP, IGNORE_ERROR.

    GetEbEventRulesRuleDeadLetterConfigCkafkaDeliveryParam

    ResourceDescription string
    ckafka resource qcs six-segment.
    TopicName string
    ckafka topic name.
    ResourceDescription string
    ckafka resource qcs six-segment.
    TopicName string
    ckafka topic name.
    resourceDescription String
    ckafka resource qcs six-segment.
    topicName String
    ckafka topic name.
    resourceDescription string
    ckafka resource qcs six-segment.
    topicName string
    ckafka topic name.
    resource_description str
    ckafka resource qcs six-segment.
    topic_name str
    ckafka topic name.
    resourceDescription String
    ckafka resource qcs six-segment.
    topicName String
    ckafka topic name.

    GetEbEventRulesRuleTarget

    TargetId string
    target Id.
    Type string
    target type.
    TargetId string
    target Id.
    Type string
    target type.
    targetId String
    target Id.
    type String
    target type.
    targetId string
    target Id.
    type string
    target type.
    target_id str
    target Id.
    type str
    target type.
    targetId String
    target Id.
    type String
    target type.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack