getEventBus function

Future<GetEventBusResult> getEventBus(
  1. GetEventBusArgs args, {
  2. InvokeOptions? options,
})

This data source can be used to fetch information about a specific EventBridge event bus. Use this data source to compute the ARN of an event bus, given the name of the bus.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.cloudwatch.getEventBus({
    name: "example-bus-name",
});
import pulumi
import pulumi_aws as aws

example = aws.cloudwatch.get_event_bus(name="example-bus-name")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = Aws.CloudWatch.GetEventBus.Invoke(new()
    {
        Name = "example-bus-name",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudwatch.LookupEventBus(ctx, &cloudwatch.LookupEventBusArgs{
			Name: "example-bus-name",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_cloudwatch_geteventbus" "example" {
  name = "example-bus-name"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.CloudwatchFunctions;
import com.pulumi.aws.cloudwatch.inputs.GetEventBusArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 = CloudwatchFunctions.getEventBus(GetEventBusArgs.builder()
            .name("example-bus-name")
            .build());

    }
}
variables:
  example:
    fn::invoke:
      function: aws:cloudwatch:getEventBus
      arguments:
        name: example-bus-name

args Arguments passed to this invoke. Arguments for getEventBus. options Invoke options controlling this call.

Implementation

Future<GetEventBusResult> getEventBus(
  GetEventBusArgs args, {
  pulumi.InvokeOptions? options,
}) async {
  final deployment = pulumi.Deployment.instance;
  final result = await deployment.invoke<Map<String, dynamic>>(
    'aws:cloudwatch/getEventBus:getEventBus',
    args.toMap(),
    options: pulumi.toDeploymentInvokeOptions(options),
  );
  return GetEventBusResult.fromMap(result);
}