# 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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetInstancesResult',
    'AwaitableGetInstancesResult',
    'get_instances',
    'get_instances_output',
]

@pulumi.output_type
class GetInstancesResult:
    """
    A collection of values returned by getInstances.
    """
    def __init__(__self__, enable_details=None, id=None, ids=None, instances=None, name_regex=None, names=None, output_file=None, query_str=None, status=None, support_engine=None):
        if enable_details and not isinstance(enable_details, bool):
            raise TypeError("Expected argument 'enable_details' to be a bool")
        pulumi.set(__self__, "enable_details", enable_details)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        pulumi.set(__self__, "ids", ids)
        if instances and not isinstance(instances, list):
            raise TypeError("Expected argument 'instances' to be a list")
        pulumi.set(__self__, "instances", instances)
        if name_regex and not isinstance(name_regex, str):
            raise TypeError("Expected argument 'name_regex' to be a str")
        pulumi.set(__self__, "name_regex", name_regex)
        if names and not isinstance(names, list):
            raise TypeError("Expected argument 'names' to be a list")
        pulumi.set(__self__, "names", names)
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        pulumi.set(__self__, "output_file", output_file)
        if query_str and not isinstance(query_str, str):
            raise TypeError("Expected argument 'query_str' to be a str")
        pulumi.set(__self__, "query_str", query_str)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if support_engine and not isinstance(support_engine, int):
            raise TypeError("Expected argument 'support_engine' to be a int")
        pulumi.set(__self__, "support_engine", support_engine)

    @property
    @pulumi.getter(name="enableDetails")
    def enable_details(self) -> Optional[builtins.bool]:
        return pulumi.get(self, "enable_details")

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

    @property
    @pulumi.getter
    def ids(self) -> Sequence[builtins.str]:
        return pulumi.get(self, "ids")

    @property
    @pulumi.getter
    def instances(self) -> Sequence['outputs.GetInstancesInstanceResult']:
        return pulumi.get(self, "instances")

    @property
    @pulumi.getter(name="nameRegex")
    def name_regex(self) -> Optional[builtins.str]:
        return pulumi.get(self, "name_regex")

    @property
    @pulumi.getter
    def names(self) -> Sequence[builtins.str]:
        return pulumi.get(self, "names")

    @property
    @pulumi.getter(name="outputFile")
    def output_file(self) -> Optional[builtins.str]:
        return pulumi.get(self, "output_file")

    @property
    @pulumi.getter(name="queryStr")
    def query_str(self) -> Optional[builtins.str]:
        return pulumi.get(self, "query_str")

    @property
    @pulumi.getter
    def status(self) -> Optional[builtins.str]:
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="supportEngine")
    def support_engine(self) -> Optional[builtins.int]:
        return pulumi.get(self, "support_engine")


class AwaitableGetInstancesResult(GetInstancesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInstancesResult(
            enable_details=self.enable_details,
            id=self.id,
            ids=self.ids,
            instances=self.instances,
            name_regex=self.name_regex,
            names=self.names,
            output_file=self.output_file,
            query_str=self.query_str,
            status=self.status,
            support_engine=self.support_engine)


def get_instances(enable_details: Optional[builtins.bool] = None,
                  ids: Optional[Sequence[builtins.str]] = None,
                  name_regex: Optional[builtins.str] = None,
                  output_file: Optional[builtins.str] = None,
                  query_str: Optional[builtins.str] = None,
                  status: Optional[builtins.str] = None,
                  support_engine: Optional[builtins.int] = None,
                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInstancesResult:
    """
    This data source provides the Lindorm Instances of the current Alibaba Cloud user.

    > **NOTE:** Available in v1.132.0+.

    ## Example Usage

    Basic Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    ids = alicloud.lindorm.get_instances()
    pulumi.export("lindormInstanceId1", ids.instances[0].id)
    name_regex = alicloud.lindorm.get_instances(name_regex="^my-Instance")
    pulumi.export("lindormInstanceId2", name_regex.instances[0].id)
    ```


    :param builtins.bool enable_details: Default to `false`. Set it to `true` can output more details about resource attributes.
    :param Sequence[builtins.str] ids: A list of Instance IDs.
    :param builtins.str name_regex: A regex string to filter results by Instance name.
    :param builtins.str output_file: File name where to save data source results (after running `pulumi preview`).
    :param builtins.str query_str: The query str, which can use `instance_name` keyword for fuzzy search.
    :param builtins.str status: Instance status, Valid values: `ACTIVATION`, `DELETED`, `CREATING`, `CLASS_CHANGING`, `LOCKED`, `INSTANCE_LEVEL_MODIFY`, `NET_MODIFYING`, `RESIZING`, `RESTARTING`, `MINOR_VERSION_TRANSING`.
    :param builtins.int support_engine: The support engine. Valid values: `1` to `7`.
    """
    __args__ = dict()
    __args__['enableDetails'] = enable_details
    __args__['ids'] = ids
    __args__['nameRegex'] = name_regex
    __args__['outputFile'] = output_file
    __args__['queryStr'] = query_str
    __args__['status'] = status
    __args__['supportEngine'] = support_engine
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('alicloud:lindorm/getInstances:getInstances', __args__, opts=opts, typ=GetInstancesResult).value

    return AwaitableGetInstancesResult(
        enable_details=pulumi.get(__ret__, 'enable_details'),
        id=pulumi.get(__ret__, 'id'),
        ids=pulumi.get(__ret__, 'ids'),
        instances=pulumi.get(__ret__, 'instances'),
        name_regex=pulumi.get(__ret__, 'name_regex'),
        names=pulumi.get(__ret__, 'names'),
        output_file=pulumi.get(__ret__, 'output_file'),
        query_str=pulumi.get(__ret__, 'query_str'),
        status=pulumi.get(__ret__, 'status'),
        support_engine=pulumi.get(__ret__, 'support_engine'))
def get_instances_output(enable_details: Optional[pulumi.Input[Optional[builtins.bool]]] = None,
                         ids: Optional[pulumi.Input[Optional[Sequence[builtins.str]]]] = None,
                         name_regex: Optional[pulumi.Input[Optional[builtins.str]]] = None,
                         output_file: Optional[pulumi.Input[Optional[builtins.str]]] = None,
                         query_str: Optional[pulumi.Input[Optional[builtins.str]]] = None,
                         status: Optional[pulumi.Input[Optional[builtins.str]]] = None,
                         support_engine: Optional[pulumi.Input[Optional[builtins.int]]] = None,
                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetInstancesResult]:
    """
    This data source provides the Lindorm Instances of the current Alibaba Cloud user.

    > **NOTE:** Available in v1.132.0+.

    ## Example Usage

    Basic Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    ids = alicloud.lindorm.get_instances()
    pulumi.export("lindormInstanceId1", ids.instances[0].id)
    name_regex = alicloud.lindorm.get_instances(name_regex="^my-Instance")
    pulumi.export("lindormInstanceId2", name_regex.instances[0].id)
    ```


    :param builtins.bool enable_details: Default to `false`. Set it to `true` can output more details about resource attributes.
    :param Sequence[builtins.str] ids: A list of Instance IDs.
    :param builtins.str name_regex: A regex string to filter results by Instance name.
    :param builtins.str output_file: File name where to save data source results (after running `pulumi preview`).
    :param builtins.str query_str: The query str, which can use `instance_name` keyword for fuzzy search.
    :param builtins.str status: Instance status, Valid values: `ACTIVATION`, `DELETED`, `CREATING`, `CLASS_CHANGING`, `LOCKED`, `INSTANCE_LEVEL_MODIFY`, `NET_MODIFYING`, `RESIZING`, `RESTARTING`, `MINOR_VERSION_TRANSING`.
    :param builtins.int support_engine: The support engine. Valid values: `1` to `7`.
    """
    __args__ = dict()
    __args__['enableDetails'] = enable_details
    __args__['ids'] = ids
    __args__['nameRegex'] = name_regex
    __args__['outputFile'] = output_file
    __args__['queryStr'] = query_str
    __args__['status'] = status
    __args__['supportEngine'] = support_engine
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('alicloud:lindorm/getInstances:getInstances', __args__, opts=opts, typ=GetInstancesResult)
    return __ret__.apply(lambda __response__: GetInstancesResult(
        enable_details=pulumi.get(__response__, 'enable_details'),
        id=pulumi.get(__response__, 'id'),
        ids=pulumi.get(__response__, 'ids'),
        instances=pulumi.get(__response__, 'instances'),
        name_regex=pulumi.get(__response__, 'name_regex'),
        names=pulumi.get(__response__, 'names'),
        output_file=pulumi.get(__response__, 'output_file'),
        query_str=pulumi.get(__response__, 'query_str'),
        status=pulumi.get(__response__, 'status'),
        support_engine=pulumi.get(__response__, 'support_engine')))
