# 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 warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class GetGroupResult:
    """
    A collection of values returned by getGroup.
    """
    def __init__(__self__, id=None, name=None, realm_id=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        The provider-assigned unique ID for this managed resource.
        """
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        if realm_id and not isinstance(realm_id, str):
            raise TypeError("Expected argument 'realm_id' to be a str")
        __self__.realm_id = realm_id
class AwaitableGetGroupResult(GetGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetGroupResult(
            id=self.id,
            name=self.name,
            realm_id=self.realm_id)

def get_group(name=None,realm_id=None,opts=None):
    """
    ## # Group data source

    This data source can be used to fetch properties of a Keycloak group for
    usage with other resources, such as `GroupRoles`.

    ### Example Usage

    ```python
    import pulumi
    import pulumi_keycloak as keycloak

    realm = keycloak.Realm("realm",
        enabled=True,
        realm="my-realm")
    offline_access = realm.id.apply(lambda id: keycloak.get_role(name="offline_access",
        realm_id=id))
    group = realm.id.apply(lambda id: keycloak.get_group(name="group",
        realm_id=id))
    group_roles = keycloak.GroupRoles("groupRoles",
        group_id=group.id,
        realm_id=realm.id,
        roles=[offline_access.id])
    ```

    ### Argument Reference

    The following arguments are supported:

    - `realm_id` - (Required) The realm this group exists within.
    - `name` - (Required) The name of the group

    ### Attributes Reference

    In addition to the arguments listed above, the following computed attributes are exported:

    - `id` - The unique ID of the group, which can be used as an argument to
      other resources supported by this provider.
    """
    __args__ = dict()


    __args__['name'] = name
    __args__['realmId'] = realm_id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('keycloak:index/getGroup:getGroup', __args__, opts=opts).value

    return AwaitableGetGroupResult(
        id=__ret__.get('id'),
        name=__ret__.get('name'),
        realm_id=__ret__.get('realmId'))
