Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.actiontrail.getConsumerGroups
Explore with Pulumi AI
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)
public static Output<GetConsumerGroupsResult> getConsumerGroups(GetConsumerGroupsArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:actiontrail/getConsumerGroups:getConsumerGroups
  arguments:
    # arguments dictionaryThe following arguments are supported:
- InstanceId string
- ID of the ALIKAFKA Instance that owns the consumer groups.
- ConsumerId stringRegex 
- 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.
- ConsumerId stringRegex 
- 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.
- consumerId StringRegex 
- 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.
- consumerId stringRegex 
- 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_ strregex 
- 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.
- consumerId StringRegex 
- 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.Ali Cloud. Action Trail. Outputs. Get Consumer Groups Group> 
- 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.
- ConsumerId stringRegex 
- OutputFile string
- ConsumerIds []string
- Groups
[]GetConsumer Groups Group 
- 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.
- ConsumerId stringRegex 
- OutputFile string
- consumerIds List<String>
- groups
List<GetConsumer Groups Group> 
- 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.
- consumerId StringRegex 
- outputFile String
- consumerIds string[]
- groups
GetConsumer Groups Group[] 
- 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.
- consumerId stringRegex 
- outputFile string
- consumer_ids Sequence[str]
- groups
Sequence[GetConsumer Groups Group] 
- 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_ strregex 
- 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.
- consumerId StringRegex 
- 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.
- Dictionary<string, string>
- 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.
- map[string]string
- 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.
- Map<String,String>
- 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.
- {[key: string]: string}
- 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.
- Mapping[str, str]
- 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.
- Map<String>
- 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 alicloudTerraform Provider.