# 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 GetGroupsResult:
    """
    A collection of values returned by getGroups.
    """
    def __init__(__self__, group_id_regex=None, groups=None, id=None, ids=None, instance_id=None, output_file=None):
        if group_id_regex and not isinstance(group_id_regex, str):
            raise TypeError("Expected argument 'group_id_regex' to be a str")
        __self__.group_id_regex = group_id_regex
        if groups and not isinstance(groups, list):
            raise TypeError("Expected argument 'groups' to be a list")
        __self__.groups = groups
        """
        A list of groups. Each element contains the following attributes:
        """
        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 ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        __self__.ids = ids
        """
        A list of group names.
        """
        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 AwaitableGetGroupsResult(GetGroupsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetGroupsResult(
            group_id_regex=self.group_id_regex,
            groups=self.groups,
            id=self.id,
            ids=self.ids,
            instance_id=self.instance_id,
            output_file=self.output_file)

def get_groups(group_id_regex=None,instance_id=None,output_file=None,opts=None):
    """
    This data source provides a list of ONS Groups in an Alibaba Cloud account according to the specified filters.

    > **NOTE:** Available in 1.53.0+

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


    :param str group_id_regex: A regex string to filter results by the group name. 
    :param str instance_id: ID of the ONS Instance that owns the groups.
    """
    __args__ = dict()


    __args__['groupIdRegex'] = group_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:rocketmq/getGroups:getGroups', __args__, opts=opts).value

    return AwaitableGetGroupsResult(
        group_id_regex=__ret__.get('groupIdRegex'),
        groups=__ret__.get('groups'),
        id=__ret__.get('id'),
        ids=__ret__.get('ids'),
        instance_id=__ret__.get('instanceId'),
        output_file=__ret__.get('outputFile'))
