// *** 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.Instances
{
    public static class GetInstance
    {
        /// <summary>
        /// Use this data source to query cvm instances.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Instances.GetInstance.InvokeAsync(new Tencentcloud.Instances.GetInstanceArgs
        ///         {
        ///             InstanceId = "ins-da412f5a",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetInstanceResult>("tencentcloud:Instances/getInstance:getInstance", args ?? new GetInstanceArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query cvm instances.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Instances.GetInstance.InvokeAsync(new Tencentcloud.Instances.GetInstanceArgs
        ///         {
        ///             InstanceId = "ins-da412f5a",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetInstanceResult>("tencentcloud:Instances/getInstance:getInstance", args ?? new GetInstanceInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetInstanceArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The available zone that the CVM instance locates at.
        /// </summary>
        [Input("availabilityZone")]
        public string? AvailabilityZone { get; set; }

        /// <summary>
        /// ID of the instances to be queried.
        /// </summary>
        [Input("instanceId")]
        public string? InstanceId { get; set; }

        /// <summary>
        /// Name of the instances to be queried.
        /// </summary>
        [Input("instanceName")]
        public string? InstanceName { get; set; }

        [Input("instanceSetIds")]
        private List<string>? _instanceSetIds;

        /// <summary>
        /// Instance set ids, max length is 100, conflict with other field.
        /// </summary>
        public List<string> InstanceSetIds
        {
            get => _instanceSetIds ?? (_instanceSetIds = new List<string>());
            set => _instanceSetIds = value;
        }

        /// <summary>
        /// The project CVM belongs to.
        /// </summary>
        [Input("projectId")]
        public int? ProjectId { get; set; }

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

        /// <summary>
        /// ID of a vpc subnetwork.
        /// </summary>
        [Input("subnetId")]
        public string? SubnetId { get; set; }

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

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

        /// <summary>
        /// ID of the vpc to be queried.
        /// </summary>
        [Input("vpcId")]
        public string? VpcId { get; set; }

        public GetInstanceArgs()
        {
        }
    }

    public sealed class GetInstanceInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The available zone that the CVM instance locates at.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// ID of the instances to be queried.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// Name of the instances to be queried.
        /// </summary>
        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        [Input("instanceSetIds")]
        private InputList<string>? _instanceSetIds;

        /// <summary>
        /// Instance set ids, max length is 100, conflict with other field.
        /// </summary>
        public InputList<string> InstanceSetIds
        {
            get => _instanceSetIds ?? (_instanceSetIds = new InputList<string>());
            set => _instanceSetIds = value;
        }

        /// <summary>
        /// The project CVM belongs to.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

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

        /// <summary>
        /// ID of a vpc subnetwork.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

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

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

        /// <summary>
        /// ID of the vpc to be queried.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public GetInstanceInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetInstanceResult
    {
        /// <summary>
        /// The available zone that the CVM instance locates at.
        /// </summary>
        public readonly string? AvailabilityZone;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// ID of the instances.
        /// </summary>
        public readonly string? InstanceId;
        /// <summary>
        /// An information list of cvm instance. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetInstanceInstanceListResult> InstanceLists;
        /// <summary>
        /// Name of the instances.
        /// </summary>
        public readonly string? InstanceName;
        public readonly ImmutableArray<string> InstanceSetIds;
        /// <summary>
        /// The project CVM belongs to.
        /// </summary>
        public readonly int? ProjectId;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// ID of a vpc subnetwork.
        /// </summary>
        public readonly string? SubnetId;
        /// <summary>
        /// Tags of the instance.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;
        /// <summary>
        /// ID of the vpc.
        /// </summary>
        public readonly string? VpcId;

        [OutputConstructor]
        private GetInstanceResult(
            string? availabilityZone,

            string id,

            string? instanceId,

            ImmutableArray<Outputs.GetInstanceInstanceListResult> instanceLists,

            string? instanceName,

            ImmutableArray<string> instanceSetIds,

            int? projectId,

            string? resultOutputFile,

            string? subnetId,

            ImmutableDictionary<string, object>? tags,

            string? vpcId)
        {
            AvailabilityZone = availabilityZone;
            Id = id;
            InstanceId = instanceId;
            InstanceLists = instanceLists;
            InstanceName = instanceName;
            InstanceSetIds = instanceSetIds;
            ProjectId = projectId;
            ResultOutputFile = resultOutputFile;
            SubnetId = subnetId;
            Tags = tags;
            VpcId = vpcId;
        }
    }
}
