1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. eventbridge
  5. getEventBuses
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.eventbridge.getEventBuses

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Event Bridge Event Buses 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 ids = alicloud.eventbridge.getEventBuses({});
    export const eventBridgeEventBusId1 = ids.then(ids => ids.buses?.[0]?.id);
    const nameRegex = alicloud.eventbridge.getEventBuses({
        nameRegex: "^my-EventBus",
    });
    export const eventBridgeEventBusId2 = nameRegex.then(nameRegex => nameRegex.buses?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.eventbridge.get_event_buses()
    pulumi.export("eventBridgeEventBusId1", ids.buses[0].id)
    name_regex = alicloud.eventbridge.get_event_buses(name_regex="^my-EventBus")
    pulumi.export("eventBridgeEventBusId2", name_regex.buses[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 {
    		ids, err := eventbridge.GetEventBuses(ctx, &eventbridge.GetEventBusesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("eventBridgeEventBusId1", ids.Buses[0].Id)
    		nameRegex, err := eventbridge.GetEventBuses(ctx, &eventbridge.GetEventBusesArgs{
    			NameRegex: pulumi.StringRef("^my-EventBus"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("eventBridgeEventBusId2", nameRegex.Buses[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.EventBridge.GetEventBuses.Invoke();
    
        var nameRegex = AliCloud.EventBridge.GetEventBuses.Invoke(new()
        {
            NameRegex = "^my-EventBus",
        });
    
        return new Dictionary<string, object?>
        {
            ["eventBridgeEventBusId1"] = ids.Apply(getEventBusesResult => getEventBusesResult.Buses[0]?.Id),
            ["eventBridgeEventBusId2"] = nameRegex.Apply(getEventBusesResult => getEventBusesResult.Buses[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.GetEventBusesArgs;
    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 ids = EventbridgeFunctions.getEventBuses();
    
            ctx.export("eventBridgeEventBusId1", ids.applyValue(getEventBusesResult -> getEventBusesResult.buses()[0].id()));
            final var nameRegex = EventbridgeFunctions.getEventBuses(GetEventBusesArgs.builder()
                .nameRegex("^my-EventBus")
                .build());
    
            ctx.export("eventBridgeEventBusId2", nameRegex.applyValue(getEventBusesResult -> getEventBusesResult.buses()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:eventbridge:getEventBuses
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:eventbridge:getEventBuses
          Arguments:
            nameRegex: ^my-EventBus
    outputs:
      eventBridgeEventBusId1: ${ids.buses[0].id}
      eventBridgeEventBusId2: ${nameRegex.buses[0].id}
    

    Using getEventBuses

    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 getEventBuses(args: GetEventBusesArgs, opts?: InvokeOptions): Promise<GetEventBusesResult>
    function getEventBusesOutput(args: GetEventBusesOutputArgs, opts?: InvokeOptions): Output<GetEventBusesResult>
    def get_event_buses(event_bus_type: Optional[str] = None,
                        ids: Optional[Sequence[str]] = None,
                        name_prefix: Optional[str] = None,
                        name_regex: Optional[str] = None,
                        output_file: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetEventBusesResult
    def get_event_buses_output(event_bus_type: Optional[pulumi.Input[str]] = None,
                        ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        name_prefix: Optional[pulumi.Input[str]] = None,
                        name_regex: Optional[pulumi.Input[str]] = None,
                        output_file: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetEventBusesResult]
    func GetEventBuses(ctx *Context, args *GetEventBusesArgs, opts ...InvokeOption) (*GetEventBusesResult, error)
    func GetEventBusesOutput(ctx *Context, args *GetEventBusesOutputArgs, opts ...InvokeOption) GetEventBusesResultOutput

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

    public static class GetEventBuses 
    {
        public static Task<GetEventBusesResult> InvokeAsync(GetEventBusesArgs args, InvokeOptions? opts = null)
        public static Output<GetEventBusesResult> Invoke(GetEventBusesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEventBusesResult> getEventBuses(GetEventBusesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:eventbridge/getEventBuses:getEventBuses
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EventBusType string
    The event bus type.
    Ids List<string>
    A list of Event Bus IDs. Its element value is same as Event Bus Name.
    NamePrefix string
    The name prefix.
    NameRegex string
    A regex string to filter results by Event Bus name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    EventBusType string
    The event bus type.
    Ids []string
    A list of Event Bus IDs. Its element value is same as Event Bus Name.
    NamePrefix string
    The name prefix.
    NameRegex string
    A regex string to filter results by Event Bus name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    eventBusType String
    The event bus type.
    ids List<String>
    A list of Event Bus IDs. Its element value is same as Event Bus Name.
    namePrefix String
    The name prefix.
    nameRegex String
    A regex string to filter results by Event Bus name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    eventBusType string
    The event bus type.
    ids string[]
    A list of Event Bus IDs. Its element value is same as Event Bus Name.
    namePrefix string
    The name prefix.
    nameRegex string
    A regex string to filter results by Event Bus name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    event_bus_type str
    The event bus type.
    ids Sequence[str]
    A list of Event Bus IDs. Its element value is same as Event Bus Name.
    name_prefix str
    The name prefix.
    name_regex str
    A regex string to filter results by Event Bus name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    eventBusType String
    The event bus type.
    ids List<String>
    A list of Event Bus IDs. Its element value is same as Event Bus Name.
    namePrefix String
    The name prefix.
    nameRegex String
    A regex string to filter results by Event Bus name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getEventBuses Result

    The following output properties are available:

    Buses List<Pulumi.AliCloud.EventBridge.Outputs.GetEventBusesBus>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    EventBusType string
    NamePrefix string
    NameRegex string
    OutputFile string
    Buses []GetEventBusesBus
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    EventBusType string
    NamePrefix string
    NameRegex string
    OutputFile string
    buses List<GetEventBusesBus>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    eventBusType String
    namePrefix String
    nameRegex String
    outputFile String
    buses GetEventBusesBus[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    eventBusType string
    namePrefix string
    nameRegex string
    outputFile string
    buses Sequence[GetEventBusesBus]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    event_bus_type str
    name_prefix str
    name_regex str
    output_file str
    buses List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    eventBusType String
    namePrefix String
    nameRegex String
    outputFile String

    Supporting Types

    GetEventBusesBus

    CreateTime string
    The time of this bus was created.
    Description string
    The description of event bus.
    EventBusName string
    The name of event bus.
    Id string
    The ID of the Event Bus. Its value is same as Queue Name.
    CreateTime string
    The time of this bus was created.
    Description string
    The description of event bus.
    EventBusName string
    The name of event bus.
    Id string
    The ID of the Event Bus. Its value is same as Queue Name.
    createTime String
    The time of this bus was created.
    description String
    The description of event bus.
    eventBusName String
    The name of event bus.
    id String
    The ID of the Event Bus. Its value is same as Queue Name.
    createTime string
    The time of this bus was created.
    description string
    The description of event bus.
    eventBusName string
    The name of event bus.
    id string
    The ID of the Event Bus. Its value is same as Queue Name.
    create_time str
    The time of this bus was created.
    description str
    The description of event bus.
    event_bus_name str
    The name of event bus.
    id str
    The ID of the Event Bus. Its value is same as Queue Name.
    createTime String
    The time of this bus was created.
    description String
    The description of event bus.
    eventBusName String
    The name of event bus.
    id String
    The ID of the Event Bus. Its value is same as Queue Name.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi