1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. eventbridge
  5. getEventSources
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

alicloud.eventbridge.getEventSources

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

    This data source provides the Event Bridge Event Sources of the current Alibaba Cloud user.

    NOTE: Available in v1.130.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.eventbridge.getEventSources({
        ids: ["example_value"],
        nameRegex: "the_resource_name",
    });
    export const firstEventBridgeEventSourceId = example.then(example => example.sources?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.eventbridge.get_event_sources(ids=["example_value"],
        name_regex="the_resource_name")
    pulumi.export("firstEventBridgeEventSourceId", example.sources[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.GetEventSources(ctx, &eventbridge.GetEventSourcesArgs{
    			Ids: []string{
    				"example_value",
    			},
    			NameRegex: pulumi.StringRef("the_resource_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstEventBridgeEventSourceId", example.Sources[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.GetEventSources.Invoke(new()
        {
            Ids = new[]
            {
                "example_value",
            },
            NameRegex = "the_resource_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstEventBridgeEventSourceId"] = example.Apply(getEventSourcesResult => getEventSourcesResult.Sources[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.GetEventSourcesArgs;
    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.getEventSources(GetEventSourcesArgs.builder()
                .ids("example_value")
                .nameRegex("the_resource_name")
                .build());
    
            ctx.export("firstEventBridgeEventSourceId", example.applyValue(getEventSourcesResult -> getEventSourcesResult.sources()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:eventbridge:getEventSources
          Arguments:
            ids:
              - example_value
            nameRegex: the_resource_name
    outputs:
      firstEventBridgeEventSourceId: ${example.sources[0].id}
    

    Using getEventSources

    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 getEventSources(args: GetEventSourcesArgs, opts?: InvokeOptions): Promise<GetEventSourcesResult>
    function getEventSourcesOutput(args: GetEventSourcesOutputArgs, opts?: InvokeOptions): Output<GetEventSourcesResult>
    def get_event_sources(ids: Optional[Sequence[str]] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetEventSourcesResult
    def get_event_sources_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetEventSourcesResult]
    func GetEventSources(ctx *Context, args *GetEventSourcesArgs, opts ...InvokeOption) (*GetEventSourcesResult, error)
    func GetEventSourcesOutput(ctx *Context, args *GetEventSourcesOutputArgs, opts ...InvokeOption) GetEventSourcesResultOutput

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

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

    The following arguments are supported:

    Ids List<string>
    A list of Event Source IDs.
    NameRegex string
    A regex string to filter results by Event Source name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Event Source IDs.
    NameRegex string
    A regex string to filter results by Event Source name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Event Source IDs.
    nameRegex String
    A regex string to filter results by Event Source name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Event Source IDs.
    nameRegex string
    A regex string to filter results by Event Source name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Event Source IDs.
    name_regex str
    A regex string to filter results by Event Source name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Event Source IDs.
    nameRegex String
    A regex string to filter results by Event Source name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getEventSources Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Sources List<Pulumi.AliCloud.EventBridge.Outputs.GetEventSourcesSource>
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Sources []GetEventSourcesSource
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    sources List<GetEventSourcesSource>
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    sources GetEventSourcesSource[]
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    sources Sequence[GetEventSourcesSource]
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    sources List<Property Map>
    nameRegex String
    outputFile String

    Supporting Types

    GetEventSourcesSource

    Description string
    The detail describe of event source.
    EventSourceName string
    The code name of event source.
    ExternalSourceConfig Dictionary<string, object>
    The config of external data source.
    ExternalSourceType string
    The type of external data source.
    Id string
    The ID of the Event Source.
    LinkedExternalSource bool
    Whether to connect to an external data source.
    Type string
    Description string
    The detail describe of event source.
    EventSourceName string
    The code name of event source.
    ExternalSourceConfig map[string]interface{}
    The config of external data source.
    ExternalSourceType string
    The type of external data source.
    Id string
    The ID of the Event Source.
    LinkedExternalSource bool
    Whether to connect to an external data source.
    Type string
    description String
    The detail describe of event source.
    eventSourceName String
    The code name of event source.
    externalSourceConfig Map<String,Object>
    The config of external data source.
    externalSourceType String
    The type of external data source.
    id String
    The ID of the Event Source.
    linkedExternalSource Boolean
    Whether to connect to an external data source.
    type String
    description string
    The detail describe of event source.
    eventSourceName string
    The code name of event source.
    externalSourceConfig {[key: string]: any}
    The config of external data source.
    externalSourceType string
    The type of external data source.
    id string
    The ID of the Event Source.
    linkedExternalSource boolean
    Whether to connect to an external data source.
    type string
    description str
    The detail describe of event source.
    event_source_name str
    The code name of event source.
    external_source_config Mapping[str, Any]
    The config of external data source.
    external_source_type str
    The type of external data source.
    id str
    The ID of the Event Source.
    linked_external_source bool
    Whether to connect to an external data source.
    type str
    description String
    The detail describe of event source.
    eventSourceName String
    The code name of event source.
    externalSourceConfig Map<Any>
    The config of external data source.
    externalSourceType String
    The type of external data source.
    id String
    The ID of the Event Source.
    linkedExternalSource Boolean
    Whether to connect to an external data source.
    type String

    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.57.0 published on Saturday, Jun 15, 2024 by Pulumi