// *** 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.Image
{
    public static class GetInstance
    {
        /// <summary>
        /// Provides an available image for the user.
        /// 
        /// The Images data source fetch proper image, which could be one of the private images of the user and images of system resources provided by TencentCloud, as well as other public images and those available on the image market.
        /// 
        /// &gt; **NOTE:** This data source will be deprecated, please use `tencentcloud.Images.getInstance` instead.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var myFavorateImage = Output.Create(Tencentcloud.Image.GetInstance.InvokeAsync(new Tencentcloud.Image.GetInstanceArgs
        ///         {
        ///             Filters = 
        ///             {
        ///                 new Tencentcloud.Image.Inputs.GetInstanceFilterArgs
        ///                 {
        ///                     Name = "image-type",
        ///                     Values = 
        ///                     {
        ///                         "PUBLIC_IMAGE",
        ///                     },
        ///                 },
        ///             },
        ///             OsName = "centos",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetInstanceResult>("tencentcloud:Image/getInstance:getInstance", args ?? new GetInstanceArgs(), options.WithDefaults());

        /// <summary>
        /// Provides an available image for the user.
        /// 
        /// The Images data source fetch proper image, which could be one of the private images of the user and images of system resources provided by TencentCloud, as well as other public images and those available on the image market.
        /// 
        /// &gt; **NOTE:** This data source will be deprecated, please use `tencentcloud.Images.getInstance` instead.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var myFavorateImage = Output.Create(Tencentcloud.Image.GetInstance.InvokeAsync(new Tencentcloud.Image.GetInstanceArgs
        ///         {
        ///             Filters = 
        ///             {
        ///                 new Tencentcloud.Image.Inputs.GetInstanceFilterArgs
        ///                 {
        ///                     Name = "image-type",
        ///                     Values = 
        ///                     {
        ///                         "PUBLIC_IMAGE",
        ///                     },
        ///                 },
        ///             },
        ///             OsName = "centos",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetInstanceResult>("tencentcloud:Image/getInstance:getInstance", args ?? new GetInstanceInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetInstanceArgs : Pulumi.InvokeArgs
    {
        [Input("filters")]
        private List<Inputs.GetInstanceFilterArgs>? _filters;

        /// <summary>
        /// One or more name/value pairs to filter.
        /// </summary>
        public List<Inputs.GetInstanceFilterArgs> Filters
        {
            get => _filters ?? (_filters = new List<Inputs.GetInstanceFilterArgs>());
            set => _filters = value;
        }

        /// <summary>
        /// A regex string to apply to the image list returned by TencentCloud. **NOTE**: it is not wildcard, should look like `image_name_regex = "^CentOS\s+6\.8\s+64\w*"`.
        /// </summary>
        [Input("imageNameRegex")]
        public string? ImageNameRegex { get; set; }

        /// <summary>
        /// A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. **NOTE**: when os_name is provided, highest priority is applied in this field instead of `image_name_regex`.
        /// </summary>
        [Input("osName")]
        public string? OsName { get; set; }

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

        public GetInstanceArgs()
        {
        }
    }

    public sealed class GetInstanceInvokeArgs : Pulumi.InvokeArgs
    {
        [Input("filters")]
        private InputList<Inputs.GetInstanceFilterInputArgs>? _filters;

        /// <summary>
        /// One or more name/value pairs to filter.
        /// </summary>
        public InputList<Inputs.GetInstanceFilterInputArgs> Filters
        {
            get => _filters ?? (_filters = new InputList<Inputs.GetInstanceFilterInputArgs>());
            set => _filters = value;
        }

        /// <summary>
        /// A regex string to apply to the image list returned by TencentCloud. **NOTE**: it is not wildcard, should look like `image_name_regex = "^CentOS\s+6\.8\s+64\w*"`.
        /// </summary>
        [Input("imageNameRegex")]
        public Input<string>? ImageNameRegex { get; set; }

        /// <summary>
        /// A string to apply with fuzzy match to the os_name attribute on the image list returned by TencentCloud. **NOTE**: when os_name is provided, highest priority is applied in this field instead of `image_name_regex`.
        /// </summary>
        [Input("osName")]
        public Input<string>? OsName { get; set; }

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

        public GetInstanceInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetInstanceResult
    {
        public readonly ImmutableArray<Outputs.GetInstanceFilterResult> Filters;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// An image id indicate the uniqueness of a certain image,  which can be used for instance creation or resetting.
        /// </summary>
        public readonly string ImageId;
        /// <summary>
        /// Name of this image.
        /// </summary>
        public readonly string ImageName;
        public readonly string? ImageNameRegex;
        public readonly string? OsName;
        public readonly string? ResultOutputFile;

        [OutputConstructor]
        private GetInstanceResult(
            ImmutableArray<Outputs.GetInstanceFilterResult> filters,

            string id,

            string imageId,

            string imageName,

            string? imageNameRegex,

            string? osName,

            string? resultOutputFile)
        {
            Filters = filters;
            Id = id;
            ImageId = imageId;
            ImageName = imageName;
            ImageNameRegex = imageNameRegex;
            OsName = osName;
            ResultOutputFile = resultOutputFile;
        }
    }
}
