// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Redis
{
    public static class GetInstances
    {
        /// <summary>
        /// Use this data source to query the detail information of redis instance.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var redislab = Output.Create(Tencentcloud.Redis.GetInstances.InvokeAsync(new Tencentcloud.Redis.GetInstancesArgs
        ///         {
        ///             Limit = 20,
        ///             ProjectId = 0,
        ///             ResultOutputFile = "/tmp/redis_instances",
        ///             SearchKey = "myredis",
        ///             Zone = "ap-hongkong-1",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetInstancesResult>("tencentcloud:Redis/getInstances:getInstances", args ?? new GetInstancesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query the detail information of redis instance.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var redislab = Output.Create(Tencentcloud.Redis.GetInstances.InvokeAsync(new Tencentcloud.Redis.GetInstancesArgs
        ///         {
        ///             Limit = 20,
        ///             ProjectId = 0,
        ///             ResultOutputFile = "/tmp/redis_instances",
        ///             SearchKey = "myredis",
        ///             Zone = "ap-hongkong-1",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetInstancesResult>("tencentcloud:Redis/getInstances:getInstances", args ?? new GetInstancesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetInstancesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The number limitation of results for a query.
        /// </summary>
        [Input("limit")]
        public int? Limit { get; set; }

        /// <summary>
        /// ID of the project to which redis instance belongs.
        /// </summary>
        [Input("projectId")]
        public int? ProjectId { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        /// <summary>
        /// Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
        /// </summary>
        [Input("searchKey")]
        public string? SearchKey { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// Tags of redis instance.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

        /// <summary>
        /// ID of an available zone.
        /// </summary>
        [Input("zone")]
        public string? Zone { get; set; }

        public GetInstancesArgs()
        {
        }
    }

    public sealed class GetInstancesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The number limitation of results for a query.
        /// </summary>
        [Input("limit")]
        public Input<int>? Limit { get; set; }

        /// <summary>
        /// ID of the project to which redis instance belongs.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        /// <summary>
        /// Key words used to match the results, and the key words can be: instance ID, instance name and IP address.
        /// </summary>
        [Input("searchKey")]
        public Input<string>? SearchKey { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Tags of redis instance.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// ID of an available zone.
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

        public GetInstancesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetInstancesResult
    {
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of redis instance. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetInstancesInstanceListResult> InstanceLists;
        public readonly int? Limit;
        /// <summary>
        /// ID of the project to which a redis instance belongs.
        /// </summary>
        public readonly int? ProjectId;
        public readonly string? ResultOutputFile;
        public readonly string? SearchKey;
        /// <summary>
        /// Tags of an instance.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;
        /// <summary>
        /// Available zone to which a redis instance belongs.
        /// </summary>
        public readonly string? Zone;

        [OutputConstructor]
        private GetInstancesResult(
            string id,

            ImmutableArray<Outputs.GetInstancesInstanceListResult> instanceLists,

            int? limit,

            int? projectId,

            string? resultOutputFile,

            string? searchKey,

            ImmutableDictionary<string, object>? tags,

            string? zone)
        {
            Id = id;
            InstanceLists = instanceLists;
            Limit = limit;
            ProjectId = projectId;
            ResultOutputFile = resultOutputFile;
            SearchKey = searchKey;
            Tags = tags;
            Zone = zone;
        }
    }
}
