1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. actiontrail
  5. getConsumerGroups
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.actiontrail.getConsumerGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides a list of ALIKAFKA Consumer Groups in an Alibaba Cloud account according to the specified filters.

    NOTE: Available in 1.56.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const consumerGroupsDs = alicloud.actiontrail.getConsumerGroups({
        instanceId: "xxx",
        consumerIdRegex: "CID-alikafkaGroupDatasourceName",
        outputFile: "consumerGroups.txt",
    });
    export const firstGroupName = consumerGroupsDs.then(consumerGroupsDs => consumerGroupsDs.consumerIds?.[0]);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    consumer_groups_ds = alicloud.actiontrail.get_consumer_groups(instance_id="xxx",
        consumer_id_regex="CID-alikafkaGroupDatasourceName",
        output_file="consumerGroups.txt")
    pulumi.export("firstGroupName", consumer_groups_ds.consumer_ids[0])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/actiontrail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		consumerGroupsDs, err := actiontrail.GetConsumerGroups(ctx, &actiontrail.GetConsumerGroupsArgs{
    			InstanceId:      "xxx",
    			ConsumerIdRegex: pulumi.StringRef("CID-alikafkaGroupDatasourceName"),
    			OutputFile:      pulumi.StringRef("consumerGroups.txt"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstGroupName", consumerGroupsDs.ConsumerIds[0])
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var consumerGroupsDs = AliCloud.ActionTrail.GetConsumerGroups.Invoke(new()
        {
            InstanceId = "xxx",
            ConsumerIdRegex = "CID-alikafkaGroupDatasourceName",
            OutputFile = "consumerGroups.txt",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstGroupName"] = consumerGroupsDs.Apply(getConsumerGroupsResult => getConsumerGroupsResult.ConsumerIds[0]),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.actiontrail.ActiontrailFunctions;
    import com.pulumi.alicloud.actiontrail.inputs.GetConsumerGroupsArgs;
    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 consumerGroupsDs = ActiontrailFunctions.getConsumerGroups(GetConsumerGroupsArgs.builder()
                .instanceId("xxx")
                .consumerIdRegex("CID-alikafkaGroupDatasourceName")
                .outputFile("consumerGroups.txt")
                .build());
    
            ctx.export("firstGroupName", consumerGroupsDs.applyValue(getConsumerGroupsResult -> getConsumerGroupsResult.consumerIds()[0]));
        }
    }
    
    variables:
      consumerGroupsDs:
        fn::invoke:
          Function: alicloud:actiontrail:getConsumerGroups
          Arguments:
            instanceId: xxx
            consumerIdRegex: CID-alikafkaGroupDatasourceName
            outputFile: consumerGroups.txt
    outputs:
      firstGroupName: ${consumerGroupsDs.consumerIds[0]}
    

    Using getConsumerGroups

    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 getConsumerGroups(args: GetConsumerGroupsArgs, opts?: InvokeOptions): Promise<GetConsumerGroupsResult>
    function getConsumerGroupsOutput(args: GetConsumerGroupsOutputArgs, opts?: InvokeOptions): Output<GetConsumerGroupsResult>
    def get_consumer_groups(consumer_id_regex: Optional[str] = None,
                            ids: Optional[Sequence[str]] = None,
                            instance_id: Optional[str] = None,
                            output_file: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetConsumerGroupsResult
    def get_consumer_groups_output(consumer_id_regex: Optional[pulumi.Input[str]] = None,
                            ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            instance_id: Optional[pulumi.Input[str]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetConsumerGroupsResult]
    func GetConsumerGroups(ctx *Context, args *GetConsumerGroupsArgs, opts ...InvokeOption) (*GetConsumerGroupsResult, error)
    func GetConsumerGroupsOutput(ctx *Context, args *GetConsumerGroupsOutputArgs, opts ...InvokeOption) GetConsumerGroupsResultOutput

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

    public static class GetConsumerGroups 
    {
        public static Task<GetConsumerGroupsResult> InvokeAsync(GetConsumerGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetConsumerGroupsResult> Invoke(GetConsumerGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetConsumerGroupsResult> getConsumerGroups(GetConsumerGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:actiontrail/getConsumerGroups:getConsumerGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    ID of the ALIKAFKA Instance that owns the consumer groups.
    ConsumerIdRegex string
    A regex string to filter results by the consumer group id.
    Ids List<string>
    A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceId string
    ID of the ALIKAFKA Instance that owns the consumer groups.
    ConsumerIdRegex string
    A regex string to filter results by the consumer group id.
    Ids []string
    A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceId String
    ID of the ALIKAFKA Instance that owns the consumer groups.
    consumerIdRegex String
    A regex string to filter results by the consumer group id.
    ids List<String>
    A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceId string
    ID of the ALIKAFKA Instance that owns the consumer groups.
    consumerIdRegex string
    A regex string to filter results by the consumer group id.
    ids string[]
    A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_id str
    ID of the ALIKAFKA Instance that owns the consumer groups.
    consumer_id_regex str
    A regex string to filter results by the consumer group id.
    ids Sequence[str]
    A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
    output_file str
    File name where to save data source results (after running pulumi preview).
    instanceId String
    ID of the ALIKAFKA Instance that owns the consumer groups.
    consumerIdRegex String
    A regex string to filter results by the consumer group id.
    ids List<String>
    A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getConsumerGroups Result

    The following output properties are available:

    ConsumerIds List<string>
    Groups List<Pulumi.AliCloud.ActionTrail.Outputs.GetConsumerGroupsGroup>
    A list of consumer group. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    InstanceId string
    The instance_id of the instance.
    Names List<string>
    A list of consumer group names.
    ConsumerIdRegex string
    OutputFile string
    ConsumerIds []string
    Groups []GetConsumerGroupsGroup
    A list of consumer group. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    The instance_id of the instance.
    Names []string
    A list of consumer group names.
    ConsumerIdRegex string
    OutputFile string
    consumerIds List<String>
    groups List<GetConsumerGroupsGroup>
    A list of consumer group. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    The instance_id of the instance.
    names List<String>
    A list of consumer group names.
    consumerIdRegex String
    outputFile String
    consumerIds string[]
    groups GetConsumerGroupsGroup[]
    A list of consumer group. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    The instance_id of the instance.
    names string[]
    A list of consumer group names.
    consumerIdRegex string
    outputFile string
    consumer_ids Sequence[str]
    groups Sequence[GetConsumerGroupsGroup]
    A list of consumer group. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    The instance_id of the instance.
    names Sequence[str]
    A list of consumer group names.
    consumer_id_regex str
    output_file str
    consumerIds List<String>
    groups List<Property Map>
    A list of consumer group. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    The instance_id of the instance.
    names List<String>
    A list of consumer group names.
    consumerIdRegex String
    outputFile String

    Supporting Types

    GetConsumerGroupsGroup

    ConsumerId string
    The name of the consumer group.
    Id string
    The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
    InstanceId string
    ID of the ALIKAFKA Instance that owns the consumer groups.
    Remark string
    The remark of the consumer group.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the consumer group.
    ConsumerId string
    The name of the consumer group.
    Id string
    The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
    InstanceId string
    ID of the ALIKAFKA Instance that owns the consumer groups.
    Remark string
    The remark of the consumer group.
    Tags map[string]interface{}
    A mapping of tags to assign to the consumer group.
    consumerId String
    The name of the consumer group.
    id String
    The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
    instanceId String
    ID of the ALIKAFKA Instance that owns the consumer groups.
    remark String
    The remark of the consumer group.
    tags Map<String,Object>
    A mapping of tags to assign to the consumer group.
    consumerId string
    The name of the consumer group.
    id string
    The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
    instanceId string
    ID of the ALIKAFKA Instance that owns the consumer groups.
    remark string
    The remark of the consumer group.
    tags {[key: string]: any}
    A mapping of tags to assign to the consumer group.
    consumer_id str
    The name of the consumer group.
    id str
    The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
    instance_id str
    ID of the ALIKAFKA Instance that owns the consumer groups.
    remark str
    The remark of the consumer group.
    tags Mapping[str, Any]
    A mapping of tags to assign to the consumer group.
    consumerId String
    The name of the consumer group.
    id String
    The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
    instanceId String
    ID of the ALIKAFKA Instance that owns the consumer groups.
    remark String
    The remark of the consumer group.
    tags Map<Any>
    A mapping of tags to assign to the consumer group.

    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.1 published on Wednesday, Jun 26, 2024 by Pulumi