Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.eventbridge.getRules
Explore with Pulumi AI
This data source provides the Event Bridge Rules of the current Alibaba Cloud user.
NOTE: Available in v1.129.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.eventbridge.getRules({
eventBusName: "example_value",
ids: ["example_value"],
nameRegex: "the_resource_name",
});
export const firstEventBridgeRuleId = example.then(example => example.rules?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.eventbridge.get_rules(event_bus_name="example_value",
ids=["example_value"],
name_regex="the_resource_name")
pulumi.export("firstEventBridgeRuleId", example.rules[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eventbridge"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := eventbridge.GetRules(ctx, &eventbridge.GetRulesArgs{
EventBusName: "example_value",
Ids: []string{
"example_value",
},
NameRegex: pulumi.StringRef("the_resource_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstEventBridgeRuleId", example.Rules[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.EventBridge.GetRules.Invoke(new()
{
EventBusName = "example_value",
Ids = new[]
{
"example_value",
},
NameRegex = "the_resource_name",
});
return new Dictionary<string, object?>
{
["firstEventBridgeRuleId"] = example.Apply(getRulesResult => getRulesResult.Rules[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.eventbridge.EventbridgeFunctions;
import com.pulumi.alicloud.eventbridge.inputs.GetRulesArgs;
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 example = EventbridgeFunctions.getRules(GetRulesArgs.builder()
.eventBusName("example_value")
.ids("example_value")
.nameRegex("the_resource_name")
.build());
ctx.export("firstEventBridgeRuleId", example.applyValue(getRulesResult -> getRulesResult.rules()[0].id()));
}
}
variables:
example:
fn::invoke:
Function: alicloud:eventbridge:getRules
Arguments:
eventBusName: example_value
ids:
- example_value
nameRegex: the_resource_name
outputs:
firstEventBridgeRuleId: ${example.rules[0].id}
Using getRules
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 getRules(args: GetRulesArgs, opts?: InvokeOptions): Promise<GetRulesResult>
function getRulesOutput(args: GetRulesOutputArgs, opts?: InvokeOptions): Output<GetRulesResult>
def get_rules(event_bus_name: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
rule_name_prefix: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRulesResult
def get_rules_output(event_bus_name: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
rule_name_prefix: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRulesResult]
func GetRules(ctx *Context, args *GetRulesArgs, opts ...InvokeOption) (*GetRulesResult, error)
func GetRulesOutput(ctx *Context, args *GetRulesOutputArgs, opts ...InvokeOption) GetRulesResultOutput
> Note: This function is named GetRules
in the Go SDK.
public static class GetRules
{
public static Task<GetRulesResult> InvokeAsync(GetRulesArgs args, InvokeOptions? opts = null)
public static Output<GetRulesResult> Invoke(GetRulesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRulesResult> getRules(GetRulesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:eventbridge/getRules:getRules
arguments:
# arguments dictionary
The following arguments are supported:
- Event
Bus stringName - The name of event bus.
- Ids List<string>
- A list of Rule IDs.
- Name
Regex string - A regex string to filter results by Rule name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Rule
Name stringPrefix - The rule name prefix.
- Status string
- Rule status, either Enable or Disable. Valid values:
DISABLE
,ENABLE
.
- Event
Bus stringName - The name of event bus.
- Ids []string
- A list of Rule IDs.
- Name
Regex string - A regex string to filter results by Rule name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Rule
Name stringPrefix - The rule name prefix.
- Status string
- Rule status, either Enable or Disable. Valid values:
DISABLE
,ENABLE
.
- event
Bus StringName - The name of event bus.
- ids List<String>
- A list of Rule IDs.
- name
Regex String - A regex string to filter results by Rule name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - rule
Name StringPrefix - The rule name prefix.
- status String
- Rule status, either Enable or Disable. Valid values:
DISABLE
,ENABLE
.
- event
Bus stringName - The name of event bus.
- ids string[]
- A list of Rule IDs.
- name
Regex string - A regex string to filter results by Rule name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - rule
Name stringPrefix - The rule name prefix.
- status string
- Rule status, either Enable or Disable. Valid values:
DISABLE
,ENABLE
.
- event_
bus_ strname - The name of event bus.
- ids Sequence[str]
- A list of Rule IDs.
- name_
regex str - A regex string to filter results by Rule name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - rule_
name_ strprefix - The rule name prefix.
- status str
- Rule status, either Enable or Disable. Valid values:
DISABLE
,ENABLE
.
- event
Bus StringName - The name of event bus.
- ids List<String>
- A list of Rule IDs.
- name
Regex String - A regex string to filter results by Rule name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - rule
Name StringPrefix - The rule name prefix.
- status String
- Rule status, either Enable or Disable. Valid values:
DISABLE
,ENABLE
.
getRules Result
The following output properties are available:
- Event
Bus stringName - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Rules
List<Pulumi.
Ali Cloud. Event Bridge. Outputs. Get Rules Rule> - Name
Regex string - Output
File string - Rule
Name stringPrefix - Status string
- Event
Bus stringName - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Rules
[]Get
Rules Rule - Name
Regex string - Output
File string - Rule
Name stringPrefix - Status string
- event
Bus StringName - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- rules
List<Get
Rules Rule> - name
Regex String - output
File String - rule
Name StringPrefix - status String
- event
Bus stringName - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- rules
Get
Rules Rule[] - name
Regex string - output
File string - rule
Name stringPrefix - status string
- event_
bus_ strname - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- rules
Sequence[Get
Rules Rule] - name_
regex str - output_
file str - rule_
name_ strprefix - status str
- event
Bus StringName - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- rules List<Property Map>
- name
Regex String - output
File String - rule
Name StringPrefix - status String
Supporting Types
GetRulesRule
- Description string
- The description of rule.
- Event
Bus stringName - The name of event bus.
- Filter
Pattern string - The pattern to match interested events.
- Id string
- The ID of the Rule.
- Rule
Name string - The name of rule.
- Status string
- Rule status, either Enable or Disable.
- Targets
List<Pulumi.
Ali Cloud. Event Bridge. Inputs. Get Rules Rule Target> - The target for rule.
- Description string
- The description of rule.
- Event
Bus stringName - The name of event bus.
- Filter
Pattern string - The pattern to match interested events.
- Id string
- The ID of the Rule.
- Rule
Name string - The name of rule.
- Status string
- Rule status, either Enable or Disable.
- Targets
[]Get
Rules Rule Target - The target for rule.
- description String
- The description of rule.
- event
Bus StringName - The name of event bus.
- filter
Pattern String - The pattern to match interested events.
- id String
- The ID of the Rule.
- rule
Name String - The name of rule.
- status String
- Rule status, either Enable or Disable.
- targets
List<Get
Rules Rule Target> - The target for rule.
- description string
- The description of rule.
- event
Bus stringName - The name of event bus.
- filter
Pattern string - The pattern to match interested events.
- id string
- The ID of the Rule.
- rule
Name string - The name of rule.
- status string
- Rule status, either Enable or Disable.
- targets
Get
Rules Rule Target[] - The target for rule.
- description str
- The description of rule.
- event_
bus_ strname - The name of event bus.
- filter_
pattern str - The pattern to match interested events.
- id str
- The ID of the Rule.
- rule_
name str - The name of rule.
- status str
- Rule status, either Enable or Disable.
- targets
Sequence[Get
Rules Rule Target] - The target for rule.
- description String
- The description of rule.
- event
Bus StringName - The name of event bus.
- filter
Pattern String - The pattern to match interested events.
- id String
- The ID of the Rule.
- rule
Name String - The name of rule.
- status String
- Rule status, either Enable or Disable.
- targets List<Property Map>
- The target for rule.
GetRulesRuleTarget
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.