# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetConsumerGroupsResult:
    """
    A collection of values returned by getConsumerGroups.
    """
    def __init__(__self__, consumer_id_regex=None, consumer_ids=None, id=None, instance_id=None, output_file=None):
        if consumer_id_regex and not isinstance(consumer_id_regex, str):
            raise TypeError("Expected argument 'consumer_id_regex' to be a str")
        __self__.consumer_id_regex = consumer_id_regex
        if consumer_ids and not isinstance(consumer_ids, list):
            raise TypeError("Expected argument 'consumer_ids' to be a list")
        __self__.consumer_ids = consumer_ids
        """
        A list of consumer group ids.
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        __self__.instance_id = instance_id
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        __self__.output_file = output_file
class AwaitableGetConsumerGroupsResult(GetConsumerGroupsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetConsumerGroupsResult(
            consumer_id_regex=self.consumer_id_regex,
            consumer_ids=self.consumer_ids,
            id=self.id,
            instance_id=self.instance_id,
            output_file=self.output_file)

def get_consumer_groups(consumer_id_regex=None,instance_id=None,output_file=None,opts=None):
    """
    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+

    > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/d/alikafka_consumer_groups.html.markdown.


    :param str consumer_id_regex: A regex string to filter results by the consumer group id. 
    :param str instance_id: ID of the ALIKAFKA Instance that owns the consumer groups.
    """
    __args__ = dict()


    __args__['consumerIdRegex'] = consumer_id_regex
    __args__['instanceId'] = instance_id
    __args__['outputFile'] = output_file
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('alicloud:actiontrail/getConsumerGroups:getConsumerGroups', __args__, opts=opts).value

    return AwaitableGetConsumerGroupsResult(
        consumer_id_regex=__ret__.get('consumerIdRegex'),
        consumer_ids=__ret__.get('consumerIds'),
        id=__ret__.get('id'),
        instance_id=__ret__.get('instanceId'),
        output_file=__ret__.get('outputFile'))
