<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<gh_stars>0// *** 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;

namespace Pulumi.AliCloud.Eds
{
    public static class GetImages
    {
        /// <summary>
        /// This data source provides the Ecd Images of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.146.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultSimpleOfficeSite = new AliCloud.Eds.SimpleOfficeSite("defaultSimpleOfficeSite", new()
        ///     {
        ///         CidrBlock = "172.16.0.0/12",
        ///         DesktopAccessType = "Internet",
        ///         OfficeSiteName = "your_simple_office_site_name",
        ///     });
        /// 
        ///     var defaultBundles = AliCloud.Eds.GetBundles.Invoke(new()
        ///     {
        ///         BundleType = "SYSTEM",
        ///     });
        /// 
        ///     var defaultEcdPolicyGroup = new AliCloud.Eds.EcdPolicyGroup("defaultEcdPolicyGroup", new()
        ///     {
        ///         PolicyGroupName = "your_policy_group_name",
        ///         Clipboard = "readwrite",
        ///         LocalDrive = "read",
        ///         AuthorizeAccessPolicyRules = new[]
        ///         {
        ///             new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs
        ///             {
        ///                 Description = "example_value",
        ///                 CidrIp = "1.2.3.4/24",
        ///             },
        ///         },
        ///         AuthorizeSecurityPolicyRules = new[]
        ///         {
        ///             new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs
        ///             {
        ///                 Type = "inflow",
        ///                 Policy = "accept",
        ///                 Description = "example_value",
        ///                 PortRange = "80/80",
        ///                 IpProtocol = "TCP",
        ///                 Priority = "1",
        ///                 CidrIp = "0.0.0.0/0",
        ///             },
        ///         },
        ///     });
        /// 
        ///     var defaultDesktop = new AliCloud.Eds.Desktop("defaultDesktop", new()
        ///     {
        ///         OfficeSiteId = defaultSimpleOfficeSite.Id,
        ///         PolicyGroupId = defaultEcdPolicyGroup.Id,
        ///         BundleId = defaultBundles.Apply(getBundlesResult =&gt; getBundlesResult.Bundles[1]?.Id),
        ///         DesktopName = "your_desktop_name",
        ///     });
        /// 
        ///     var defaultImage = new AliCloud.Eds.Image("defaultImage", new()
        ///     {
        ///         ImageName = "your_image_name",
        ///         DesktopId = defaultDesktop.Id,
        ///         Description = "example_value",
        ///     });
        /// 
        ///     var ids = AliCloud.Eds.GetImages.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             defaultImage.Id,
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.Eds.GetImages.Invoke(new()
        ///     {
        ///         NameRegex = defaultImage.ImageName,
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["ecdImageId1"] = ids.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
        ///         ["ecdImageId2"] = nameRegex.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetImagesResult> InvokeAsync(GetImagesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetImagesResult>("alicloud:eds/getImages:getImages", args ?? new GetImagesArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Ecd Images of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.146.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultSimpleOfficeSite = new AliCloud.Eds.SimpleOfficeSite("defaultSimpleOfficeSite", new()
        ///     {
        ///         CidrBlock = "172.16.0.0/12",
        ///         DesktopAccessType = "Internet",
        ///         OfficeSiteName = "your_simple_office_site_name",
        ///     });
        /// 
        ///     var defaultBundles = AliCloud.Eds.GetBundles.Invoke(new()
        ///     {
        ///         BundleType = "SYSTEM",
        ///     });
        /// 
        ///     var defaultEcdPolicyGroup = new AliCloud.Eds.EcdPolicyGroup("defaultEcdPolicyGroup", new()
        ///     {
        ///         PolicyGroupName = "your_policy_group_name",
        ///         Clipboard = "readwrite",
        ///         LocalDrive = "read",
        ///         AuthorizeAccessPolicyRules = new[]
        ///         {
        ///             new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs
        ///             {
        ///                 Description = "example_value",
        ///                 CidrIp = "1.2.3.4/24",
        ///             },
        ///         },
        ///         AuthorizeSecurityPolicyRules = new[]
        ///         {
        ///             new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs
        ///             {
        ///                 Type = "inflow",
        ///                 Policy = "accept",
        ///                 Description = "example_value",
        ///                 PortRange = "80/80",
        ///                 IpProtocol = "TCP",
        ///                 Priority = "1",
        ///                 CidrIp = "0.0.0.0/0",
        ///             },
        ///         },
        ///     });
        /// 
        ///     var defaultDesktop = new AliCloud.Eds.Desktop("defaultDesktop", new()
        ///     {
        ///         OfficeSiteId = defaultSimpleOfficeSite.Id,
        ///         PolicyGroupId = defaultEcdPolicyGroup.Id,
        ///         BundleId = defaultBundles.Apply(getBundlesResult =&gt; getBundlesResult.Bundles[1]?.Id),
        ///         DesktopName = "your_desktop_name",
        ///     });
        /// 
        ///     var defaultImage = new AliCloud.Eds.Image("defaultImage", new()
        ///     {
        ///         ImageName = "your_image_name",
        ///         DesktopId = defaultDesktop.Id,
        ///         Description = "example_value",
        ///     });
        /// 
        ///     var ids = AliCloud.Eds.GetImages.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             defaultImage.Id,
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.Eds.GetImages.Invoke(new()
        ///     {
        ///         NameRegex = defaultImage.ImageName,
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["ecdImageId1"] = ids.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
        ///         ["ecdImageId2"] = nameRegex.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetImagesResult> Invoke(GetImagesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetImagesResult>("alicloud:eds/getImages:getImages", args ?? new GetImagesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetImagesArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The desktop type of the image.
        /// </summary>
        [Input("desktopInstanceType")]
        public string? DesktopInstanceType { get; set; }

        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of Image IDs.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

        /// <summary>
        /// The image type of the image. Valid values: `SYSTEM`, `CUSTOM`.
        /// </summary>
        [Input("imageType")]
        public string? ImageType { get; set; }

        /// <summary>
        /// A regex string to filter results by Image name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        /// <summary>
        /// The os type of the image.
        /// </summary>
        [Input("osType")]
        public string? OsType { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// The status of the image. Valid values: `Creating`, `Available`, `CreateFailed`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        public GetImagesArgs()
        {
        }
        public static new GetImagesArgs Empty => new GetImagesArgs();
    }

    public sealed class GetImagesInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The desktop type of the image.
        /// </summary>
        [Input("desktopInstanceType")]
        public Input<string>? DesktopInstanceType { get; set; }

        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of Image IDs.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

        /// <summary>
        /// The image type of the image. Valid values: `SYSTEM`, `CUSTOM`.
        /// </summary>
        [Input("imageType")]
        public Input<string>? ImageType { get; set; }

        /// <summary>
        /// A regex string to filter results by Image name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

        /// <summary>
        /// The os type of the image.
        /// </summary>
        [Input("osType")]
        public Input<string>? OsType { get; set; }

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

        /// <summary>
        /// The status of the image. Valid values: `Creating`, `Available`, `CreateFailed`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        public GetImagesInvokeArgs()
        {
        }
        public static new GetImagesInvokeArgs Empty => new GetImagesInvokeArgs();
    }


    [OutputType]
    public sealed class GetImagesResult
    {
        public readonly string? DesktopInstanceType;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? ImageType;
        public readonly ImmutableArray<Outputs.GetImagesImageResult> Images;
        public readonly string? NameRegex;
        public readonly ImmutableArray<string> Names;
        public readonly string? OsType;
        public readonly string? OutputFile;
        public readonly string? Status;

        [OutputConstructor]
        private GetImagesResult(
            string? desktopInstanceType,

            string id,

            ImmutableArray<string> ids,

            string? imageType,

            ImmutableArray<Outputs.GetImagesImageResult> images,

            string? nameRegex,

            ImmutableArray<string> names,

            string? osType,

            string? outputFile,

            string? status)
        {
            DesktopInstanceType = desktopInstanceType;
            Id = id;
            Ids = ids;
            ImageType = imageType;
            Images = images;
            NameRegex = nameRegex;
            Names = names;
            OsType = osType;
            OutputFile = outputFile;
            Status = status;
        }
    }
}
