1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. actiontrail
  5. getConsumerGroups
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.actiontrail.getConsumerGroups

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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]);
Copy
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])
Copy
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
	})
}
Copy
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]),
    };
});
Copy
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]));
    }
}
Copy
variables:
  consumerGroupsDs:
    fn::invoke:
      function: alicloud:actiontrail:getConsumerGroups
      arguments:
        instanceId: xxx
        consumerIdRegex: CID-alikafkaGroupDatasourceName
        outputFile: consumerGroups.txt
outputs:
  firstGroupName: ${consumerGroupsDs.consumerIds[0]}
Copy

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>
Copy
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]
Copy
func GetConsumerGroups(ctx *Context, args *GetConsumerGroupsArgs, opts ...InvokeOption) (*GetConsumerGroupsResult, error)
func GetConsumerGroupsOutput(ctx *Context, args *GetConsumerGroupsOutputArgs, opts ...InvokeOption) GetConsumerGroupsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetConsumerGroupsResult> getConsumerGroups(GetConsumerGroupsArgs args, InvokeOptions options)
public static Output<GetConsumerGroupsResult> getConsumerGroups(GetConsumerGroupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:actiontrail/getConsumerGroups:getConsumerGroups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

InstanceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the ALIKAFKA Instance that owns the consumer groups.
ConsumerIdRegex Changes to this property will trigger replacement. string
A regex string to filter results by the consumer group id.
Ids Changes to this property will trigger replacement. List<string>
A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
OutputFile Changes to this property will trigger replacement. string
File name where to save data source results (after running pulumi preview).
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the ALIKAFKA Instance that owns the consumer groups.
ConsumerIdRegex Changes to this property will trigger replacement. string
A regex string to filter results by the consumer group id.
Ids Changes to this property will trigger replacement. []string
A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
OutputFile Changes to this property will trigger replacement. string
File name where to save data source results (after running pulumi preview).
instanceId
This property is required.
Changes to this property will trigger replacement.
String
ID of the ALIKAFKA Instance that owns the consumer groups.
consumerIdRegex Changes to this property will trigger replacement. String
A regex string to filter results by the consumer group id.
ids Changes to this property will trigger replacement. List<String>
A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
outputFile Changes to this property will trigger replacement. String
File name where to save data source results (after running pulumi preview).
instanceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the ALIKAFKA Instance that owns the consumer groups.
consumerIdRegex Changes to this property will trigger replacement. string
A regex string to filter results by the consumer group id.
ids Changes to this property will trigger replacement. string[]
A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
outputFile Changes to this property will trigger replacement. string
File name where to save data source results (after running pulumi preview).
instance_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the ALIKAFKA Instance that owns the consumer groups.
consumer_id_regex Changes to this property will trigger replacement. str
A regex string to filter results by the consumer group id.
ids Changes to this property will trigger replacement. Sequence[str]
A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
output_file Changes to this property will trigger replacement. str
File name where to save data source results (after running pulumi preview).
instanceId
This property is required.
Changes to this property will trigger replacement.
String
ID of the ALIKAFKA Instance that owns the consumer groups.
consumerIdRegex Changes to this property will trigger replacement. String
A regex string to filter results by the consumer group id.
ids Changes to this property will trigger replacement. List<String>
A list of ALIKAFKA Consumer Groups IDs, It is formatted to <instance_id>:<consumer_id>.
outputFile Changes to this property will trigger replacement. 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 This property is required. string
The name of the consumer group.
Id This property is required. string
The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
InstanceId This property is required. string
ID of the ALIKAFKA Instance that owns the consumer groups.
Remark This property is required. string
The remark of the consumer group.
Tags Dictionary<string, string>
A mapping of tags to assign to the consumer group.
ConsumerId This property is required. string
The name of the consumer group.
Id This property is required. string
The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
InstanceId This property is required. string
ID of the ALIKAFKA Instance that owns the consumer groups.
Remark This property is required. string
The remark of the consumer group.
Tags map[string]string
A mapping of tags to assign to the consumer group.
consumerId This property is required. String
The name of the consumer group.
id This property is required. String
The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
instanceId This property is required. String
ID of the ALIKAFKA Instance that owns the consumer groups.
remark This property is required. String
The remark of the consumer group.
tags Map<String,String>
A mapping of tags to assign to the consumer group.
consumerId This property is required. string
The name of the consumer group.
id This property is required. string
The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
instanceId This property is required. string
ID of the ALIKAFKA Instance that owns the consumer groups.
remark This property is required. string
The remark of the consumer group.
tags {[key: string]: string}
A mapping of tags to assign to the consumer group.
consumer_id This property is required. str
The name of the consumer group.
id This property is required. str
The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
instance_id This property is required. str
ID of the ALIKAFKA Instance that owns the consumer groups.
remark This property is required. str
The remark of the consumer group.
tags Mapping[str, str]
A mapping of tags to assign to the consumer group.
consumerId This property is required. String
The name of the consumer group.
id This property is required. String
The ID of the consumer group, It is formatted to <instance_id>:<consumer_id>.
instanceId This property is required. String
ID of the ALIKAFKA Instance that owns the consumer groups.
remark This property is required. String
The remark of the consumer group.
tags 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 alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi