# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = [
    'GetOpenSearchAclRuleResult',
    'AwaitableGetOpenSearchAclRuleResult',
    'get_open_search_acl_rule',
    'get_open_search_acl_rule_output',
]

@pulumi.output_type
class GetOpenSearchAclRuleResult:
    """
    A collection of values returned by getOpenSearchAclRule.
    """
    def __init__(__self__, id=None, index=None, permission=None, project=None, service_name=None, username=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if index and not isinstance(index, str):
            raise TypeError("Expected argument 'index' to be a str")
        pulumi.set(__self__, "index", index)
        if permission and not isinstance(permission, str):
            raise TypeError("Expected argument 'permission' to be a str")
        pulumi.set(__self__, "permission", permission)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if service_name and not isinstance(service_name, str):
            raise TypeError("Expected argument 'service_name' to be a str")
        pulumi.set(__self__, "service_name", service_name)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def index(self) -> str:
        """
        The index pattern for this ACL entry. Maximum length: `249`. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "index")

    @property
    @pulumi.getter
    def permission(self) -> str:
        """
        The permissions for this ACL entry. The possible values are `deny`, `admin`, `read`, `readwrite` and `write`.
        """
        return pulumi.get(self, "permission")

    @property
    @pulumi.getter
    def project(self) -> str:
        """
        The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> str:
        """
        The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def username(self) -> str:
        """
        The username for the ACL entry. Maximum length: `40`. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "username")


class AwaitableGetOpenSearchAclRuleResult(GetOpenSearchAclRuleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetOpenSearchAclRuleResult(
            id=self.id,
            index=self.index,
            permission=self.permission,
            project=self.project,
            service_name=self.service_name,
            username=self.username)


def get_open_search_acl_rule(index: Optional[str] = None,
                             permission: Optional[str] = None,
                             project: Optional[str] = None,
                             service_name: Optional[str] = None,
                             username: Optional[str] = None,
                             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetOpenSearchAclRuleResult:
    """
    The OpenSearch ACL Rule data source provides information about an existing Aiven OpenSearch ACL Rule.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_aiven as aiven

    os_acl_rule = aiven.get_open_search_acl_rule(project=os_acls_config["project"],
        service_name=os_acls_config["serviceName"],
        username="<USERNAME>",
        index="<INDEX>")
    ```


    :param str index: The index pattern for this ACL entry. Maximum length: `249`. Changing this property forces recreation of the resource.
    :param str permission: The permissions for this ACL entry. The possible values are `deny`, `admin`, `read`, `readwrite` and `write`.
    :param str project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str username: The username for the ACL entry. Maximum length: `40`. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    """
    __args__ = dict()
    __args__['index'] = index
    __args__['permission'] = permission
    __args__['project'] = project
    __args__['serviceName'] = service_name
    __args__['username'] = username
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('aiven:index/getOpenSearchAclRule:getOpenSearchAclRule', __args__, opts=opts, typ=GetOpenSearchAclRuleResult).value

    return AwaitableGetOpenSearchAclRuleResult(
        id=pulumi.get(__ret__, 'id'),
        index=pulumi.get(__ret__, 'index'),
        permission=pulumi.get(__ret__, 'permission'),
        project=pulumi.get(__ret__, 'project'),
        service_name=pulumi.get(__ret__, 'service_name'),
        username=pulumi.get(__ret__, 'username'))


@_utilities.lift_output_func(get_open_search_acl_rule)
def get_open_search_acl_rule_output(index: Optional[pulumi.Input[str]] = None,
                                    permission: Optional[pulumi.Input[str]] = None,
                                    project: Optional[pulumi.Input[str]] = None,
                                    service_name: Optional[pulumi.Input[str]] = None,
                                    username: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetOpenSearchAclRuleResult]:
    """
    The OpenSearch ACL Rule data source provides information about an existing Aiven OpenSearch ACL Rule.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_aiven as aiven

    os_acl_rule = aiven.get_open_search_acl_rule(project=os_acls_config["project"],
        service_name=os_acls_config["serviceName"],
        username="<USERNAME>",
        index="<INDEX>")
    ```


    :param str index: The index pattern for this ACL entry. Maximum length: `249`. Changing this property forces recreation of the resource.
    :param str permission: The permissions for this ACL entry. The possible values are `deny`, `admin`, `read`, `readwrite` and `write`.
    :param str project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str username: The username for the ACL entry. Maximum length: `40`. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    """
    ...
