1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. eventbridge
  5. getEventBuses
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.eventbridge.getEventBuses

Explore with Pulumi AI

Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetEventBuses(ctx *Context, args *GetEventBusesArgs, opts ...InvokeOption) (*GetEventBusesResult, error)
func GetEventBusesOutput(ctx *Context, args *GetEventBusesOutputArgs, opts ...InvokeOption) GetEventBusesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetEventBusesResult> getEventBuses(GetEventBusesArgs args, InvokeOptions options)
public static Output<GetEventBusesResult> getEventBuses(GetEventBusesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:eventbridge/getEventBuses:getEventBuses
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EventBusType Changes to this property will trigger replacement. string
The event bus type.
Ids Changes to this property will trigger replacement. List<string>
A list of Event Bus IDs. Its element value is same as Event Bus Name.
NamePrefix Changes to this property will trigger replacement. string
The name prefix.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The event bus type.
Ids Changes to this property will trigger replacement. []string
A list of Event Bus IDs. Its element value is same as Event Bus Name.
NamePrefix Changes to this property will trigger replacement. string
The name prefix.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The event bus type.
ids Changes to this property will trigger replacement. List<String>
A list of Event Bus IDs. Its element value is same as Event Bus Name.
namePrefix Changes to this property will trigger replacement. String
The name prefix.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The event bus type.
ids Changes to this property will trigger replacement. string[]
A list of Event Bus IDs. Its element value is same as Event Bus Name.
namePrefix Changes to this property will trigger replacement. string
The name prefix.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The event bus type.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Event Bus IDs. Its element value is same as Event Bus Name.
name_prefix Changes to this property will trigger replacement. str
The name prefix.
name_regex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The event bus type.
ids Changes to this property will trigger replacement. List<String>
A list of Event Bus IDs. Its element value is same as Event Bus Name.
namePrefix Changes to this property will trigger replacement. String
The name prefix.
nameRegex Changes to this property will trigger replacement. 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 This property is required. string
The time of this bus was created.
Description This property is required. string
The description of event bus.
EventBusName This property is required. string
The name of event bus.
Id This property is required. string
The ID of the Event Bus. Its value is same as Queue Name.
CreateTime This property is required. string
The time of this bus was created.
Description This property is required. string
The description of event bus.
EventBusName This property is required. string
The name of event bus.
Id This property is required. string
The ID of the Event Bus. Its value is same as Queue Name.
createTime This property is required. String
The time of this bus was created.
description This property is required. String
The description of event bus.
eventBusName This property is required. String
The name of event bus.
id This property is required. String
The ID of the Event Bus. Its value is same as Queue Name.
createTime This property is required. string
The time of this bus was created.
description This property is required. string
The description of event bus.
eventBusName This property is required. string
The name of event bus.
id This property is required. string
The ID of the Event Bus. Its value is same as Queue Name.
create_time This property is required. str
The time of this bus was created.
description This property is required. str
The description of event bus.
event_bus_name This property is required. str
The name of event bus.
id This property is required. str
The ID of the Event Bus. Its value is same as Queue Name.
createTime This property is required. String
The time of this bus was created.
description This property is required. String
The description of event bus.
eventBusName This property is required. String
The name of event bus.
id This property is required. 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.
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi