<filename>sdk/dotnet/ComputeImage.cs// *** 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.Yandex
{
    /// <summary>
    /// Creates a virtual machine image resource for the Yandex Compute Cloud service from an existing
    /// tarball. For more information, see [the official documentation](https://cloud.yandex.com/docs/compute/concepts/image).
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Yandex = Pulumi.Yandex;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var foo_image = new Yandex.ComputeImage("foo-image", new()
    ///     {
    ///         SourceUrl = "https://storage.yandexcloud.net/lucky-images/kube-it.img",
    ///     });
    /// 
    ///     var vm = new Yandex.ComputeInstance("vm", new()
    ///     {
    ///         BootDisk = new Yandex.Inputs.ComputeInstanceBootDiskArgs
    ///         {
    ///             InitializeParams = new Yandex.Inputs.ComputeInstanceBootDiskInitializeParamsArgs
    ///             {
    ///                 ImageId = foo_image.Id,
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// A VM image can be imported using the `id` of the resource, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import yandex:index/computeImage:ComputeImage web-image image_id
    /// ```
    /// </summary>
    [YandexResourceType("yandex:index/computeImage:ComputeImage")]
    public partial class ComputeImage : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Creation timestamp of the image.
        /// </summary>
        [Output("createdAt")]
        public Output<string> CreatedAt { get; private set; } = null!;

        /// <summary>
        /// An optional description of the image. Provide this property when
        /// you create a resource.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// The name of the image family to which this image belongs.
        /// </summary>
        [Output("family")]
        public Output<string?> Family { get; private set; } = null!;

        /// <summary>
        /// The ID of the folder that the resource belongs to. If it
        /// is not provided, the default provider folder is used.
        /// </summary>
        [Output("folderId")]
        public Output<string> FolderId { get; private set; } = null!;

        /// <summary>
        /// A set of key/value label pairs to assign to the image.
        /// </summary>
        [Output("labels")]
        public Output<ImmutableDictionary<string, string>?> Labels { get; private set; } = null!;

        /// <summary>
        /// Minimum size in GB of the disk that will be created from this image.
        /// </summary>
        [Output("minDiskSize")]
        public Output<int> MinDiskSize { get; private set; } = null!;

        /// <summary>
        /// Name of the disk.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Operating system type that is contained in the image. Possible values: "LINUX", "WINDOWS".
        /// </summary>
        [Output("osType")]
        public Output<string> OsType { get; private set; } = null!;

        /// <summary>
        /// Optimize the image to create a disk.
        /// </summary>
        [Output("pooled")]
        public Output<bool> Pooled { get; private set; } = null!;

        /// <summary>
        /// License IDs that indicate which licenses are
        /// attached to this image.
        /// </summary>
        [Output("productIds")]
        public Output<ImmutableArray<string>> ProductIds { get; private set; } = null!;

        /// <summary>
        /// The size of the image, specified in GB.
        /// </summary>
        [Output("size")]
        public Output<int> Size { get; private set; } = null!;

        /// <summary>
        /// The ID of a disk to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Output("sourceDisk")]
        public Output<string> SourceDisk { get; private set; } = null!;

        /// <summary>
        /// The name of the family to use as the source of the new image.
        /// The ID of the latest image is taken from the "standard-images" folder. Changing the family forces
        /// a new resource to be created.
        /// </summary>
        [Output("sourceFamily")]
        public Output<string> SourceFamily { get; private set; } = null!;

        /// <summary>
        /// The ID of an existing image to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Output("sourceImage")]
        public Output<string> SourceImage { get; private set; } = null!;

        /// <summary>
        /// The ID of a snapshot to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Output("sourceSnapshot")]
        public Output<string> SourceSnapshot { get; private set; } = null!;

        /// <summary>
        /// The URL to use as the source of the
        /// image. Changing this URL forces a new resource to be created.
        /// </summary>
        [Output("sourceUrl")]
        public Output<string> SourceUrl { get; private set; } = null!;

        /// <summary>
        /// The status of the image.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;


        /// <summary>
        /// Create a ComputeImage resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public ComputeImage(string name, ComputeImageArgs? args = null, CustomResourceOptions? options = null)
            : base("yandex:index/computeImage:ComputeImage", name, args ?? new ComputeImageArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ComputeImage(string name, Input<string> id, ComputeImageState? state = null, CustomResourceOptions? options = null)
            : base("yandex:index/computeImage:ComputeImage", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/regrau/pulumi-yandex/releases",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing ComputeImage resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static ComputeImage Get(string name, Input<string> id, ComputeImageState? state = null, CustomResourceOptions? options = null)
        {
            return new ComputeImage(name, id, state, options);
        }
    }

    public sealed class ComputeImageArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// An optional description of the image. Provide this property when
        /// you create a resource.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The name of the image family to which this image belongs.
        /// </summary>
        [Input("family")]
        public Input<string>? Family { get; set; }

        /// <summary>
        /// The ID of the folder that the resource belongs to. If it
        /// is not provided, the default provider folder is used.
        /// </summary>
        [Input("folderId")]
        public Input<string>? FolderId { get; set; }

        [Input("labels")]
        private InputMap<string>? _labels;

        /// <summary>
        /// A set of key/value label pairs to assign to the image.
        /// </summary>
        public InputMap<string> Labels
        {
            get => _labels ?? (_labels = new InputMap<string>());
            set => _labels = value;
        }

        /// <summary>
        /// Minimum size in GB of the disk that will be created from this image.
        /// </summary>
        [Input("minDiskSize")]
        public Input<int>? MinDiskSize { get; set; }

        /// <summary>
        /// Name of the disk.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Operating system type that is contained in the image. Possible values: "LINUX", "WINDOWS".
        /// </summary>
        [Input("osType")]
        public Input<string>? OsType { get; set; }

        /// <summary>
        /// Optimize the image to create a disk.
        /// </summary>
        [Input("pooled")]
        public Input<bool>? Pooled { get; set; }

        [Input("productIds")]
        private InputList<string>? _productIds;

        /// <summary>
        /// License IDs that indicate which licenses are
        /// attached to this image.
        /// </summary>
        public InputList<string> ProductIds
        {
            get => _productIds ?? (_productIds = new InputList<string>());
            set => _productIds = value;
        }

        /// <summary>
        /// The ID of a disk to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Input("sourceDisk")]
        public Input<string>? SourceDisk { get; set; }

        /// <summary>
        /// The name of the family to use as the source of the new image.
        /// The ID of the latest image is taken from the "standard-images" folder. Changing the family forces
        /// a new resource to be created.
        /// </summary>
        [Input("sourceFamily")]
        public Input<string>? SourceFamily { get; set; }

        /// <summary>
        /// The ID of an existing image to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Input("sourceImage")]
        public Input<string>? SourceImage { get; set; }

        /// <summary>
        /// The ID of a snapshot to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Input("sourceSnapshot")]
        public Input<string>? SourceSnapshot { get; set; }

        /// <summary>
        /// The URL to use as the source of the
        /// image. Changing this URL forces a new resource to be created.
        /// </summary>
        [Input("sourceUrl")]
        public Input<string>? SourceUrl { get; set; }

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

    public sealed class ComputeImageState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Creation timestamp of the image.
        /// </summary>
        [Input("createdAt")]
        public Input<string>? CreatedAt { get; set; }

        /// <summary>
        /// An optional description of the image. Provide this property when
        /// you create a resource.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The name of the image family to which this image belongs.
        /// </summary>
        [Input("family")]
        public Input<string>? Family { get; set; }

        /// <summary>
        /// The ID of the folder that the resource belongs to. If it
        /// is not provided, the default provider folder is used.
        /// </summary>
        [Input("folderId")]
        public Input<string>? FolderId { get; set; }

        [Input("labels")]
        private InputMap<string>? _labels;

        /// <summary>
        /// A set of key/value label pairs to assign to the image.
        /// </summary>
        public InputMap<string> Labels
        {
            get => _labels ?? (_labels = new InputMap<string>());
            set => _labels = value;
        }

        /// <summary>
        /// Minimum size in GB of the disk that will be created from this image.
        /// </summary>
        [Input("minDiskSize")]
        public Input<int>? MinDiskSize { get; set; }

        /// <summary>
        /// Name of the disk.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Operating system type that is contained in the image. Possible values: "LINUX", "WINDOWS".
        /// </summary>
        [Input("osType")]
        public Input<string>? OsType { get; set; }

        /// <summary>
        /// Optimize the image to create a disk.
        /// </summary>
        [Input("pooled")]
        public Input<bool>? Pooled { get; set; }

        [Input("productIds")]
        private InputList<string>? _productIds;

        /// <summary>
        /// License IDs that indicate which licenses are
        /// attached to this image.
        /// </summary>
        public InputList<string> ProductIds
        {
            get => _productIds ?? (_productIds = new InputList<string>());
            set => _productIds = value;
        }

        /// <summary>
        /// The size of the image, specified in GB.
        /// </summary>
        [Input("size")]
        public Input<int>? Size { get; set; }

        /// <summary>
        /// The ID of a disk to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Input("sourceDisk")]
        public Input<string>? SourceDisk { get; set; }

        /// <summary>
        /// The name of the family to use as the source of the new image.
        /// The ID of the latest image is taken from the "standard-images" folder. Changing the family forces
        /// a new resource to be created.
        /// </summary>
        [Input("sourceFamily")]
        public Input<string>? SourceFamily { get; set; }

        /// <summary>
        /// The ID of an existing image to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Input("sourceImage")]
        public Input<string>? SourceImage { get; set; }

        /// <summary>
        /// The ID of a snapshot to use as the source of the
        /// image. Changing this ID forces a new resource to be created.
        /// </summary>
        [Input("sourceSnapshot")]
        public Input<string>? SourceSnapshot { get; set; }

        /// <summary>
        /// The URL to use as the source of the
        /// image. Changing this URL forces a new resource to be created.
        /// </summary>
        [Input("sourceUrl")]
        public Input<string>? SourceUrl { get; set; }

        /// <summary>
        /// The status of the image.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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