// *** WARNING: this file was generated by pulumigen. ***
// *** 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.ScalewayInstances.Servers
{
    [ScalewayInstancesResourceType("scaleway-instances:servers:Server")]
    public partial class Server : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The boot type to use
        /// </summary>
        [Output("boot_type")]
        public Output<Pulumi.ScalewayInstances.Servers.BootType?> Boot_type { get; private set; } = null!;

        /// <summary>
        /// The bootscript ID to use when `boot_type` is set to `bootscript`
        /// </summary>
        [Output("bootscript")]
        public Output<string?> Bootscript { get; private set; } = null!;

        /// <summary>
        /// Define the server commercial type (i.e. GP1-S)
        /// </summary>
        [Output("commercial_type")]
        public Output<string> Commercial_type { get; private set; } = null!;

        /// <summary>
        /// Define if a dynamic IP is required for the instance
        /// </summary>
        [Output("dynamic_ip_required")]
        public Output<bool?> Dynamic_ip_required { get; private set; } = null!;

        /// <summary>
        /// True if IPv6 is enabled on the server
        /// </summary>
        [Output("enable_ipv6")]
        public Output<bool?> Enable_ipv6 { get; private set; } = null!;

        /// <summary>
        /// The server image ID
        /// </summary>
        [Output("image")]
        public Output<string?> Image { get; private set; } = null!;

        /// <summary>
        /// The server name
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// The server organization ID
        /// </summary>
        [Output("organization")]
        public Output<string?> Organization { get; private set; } = null!;

        /// <summary>
        /// Placement group ID if server must be part of a placement group
        /// </summary>
        [Output("placement_group")]
        public Output<string?> Placement_group { get; private set; } = null!;

        /// <summary>
        /// The server project ID
        /// </summary>
        [Output("project")]
        public Output<string?> Project { get; private set; } = null!;

        /// <summary>
        /// The ID of the reserved IP to attach to the server
        /// </summary>
        [Output("public_ip")]
        public Output<string?> Public_ip { get; private set; } = null!;

        /// <summary>
        /// The security group ID
        /// </summary>
        [Output("security_group")]
        public Output<string?> Security_group { get; private set; } = null!;

        /// <summary>
        /// The server tags
        /// </summary>
        [Output("tags")]
        public Output<ImmutableArray<string>> Tags { get; private set; } = null!;

        [Output("volumes")]
        public Output<ImmutableDictionary<string, Outputs.ScalewayInstanceV1VolumeServerTemplate>?> Volumes { get; private set; } = null!;


        /// <summary>
        /// Create a Server 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 Server(string name, ServerArgs args, CustomResourceOptions? options = null)
            : base("scaleway-instances:servers:Server", name, args ?? new ServerArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Server(string name, Input<string> id, CustomResourceOptions? options = null)
            : base("scaleway-instances:servers:Server", name, null, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/cloudy-sky-software/pulumi-scaleway-instances",
            };
            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 Server 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="options">A bag of options that control this resource's behavior</param>
        public static Server Get(string name, Input<string> id, CustomResourceOptions? options = null)
        {
            return new Server(name, id, options);
        }
    }

    public sealed class ServerArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The boot type to use
        /// </summary>
        [Input("boot_type")]
        public Input<Pulumi.ScalewayInstances.Servers.BootType>? Boot_type { get; set; }

        /// <summary>
        /// The bootscript ID to use when `boot_type` is set to `bootscript`
        /// </summary>
        [Input("bootscript")]
        public Input<string>? Bootscript { get; set; }

        /// <summary>
        /// Define the server commercial type (i.e. GP1-S)
        /// </summary>
        [Input("commercial_type", required: true)]
        public Input<string> Commercial_type { get; set; } = null!;

        /// <summary>
        /// Define if a dynamic IP is required for the instance
        /// </summary>
        [Input("dynamic_ip_required")]
        public Input<bool>? Dynamic_ip_required { get; set; }

        /// <summary>
        /// True if IPv6 is enabled on the server
        /// </summary>
        [Input("enable_ipv6")]
        public Input<bool>? Enable_ipv6 { get; set; }

        /// <summary>
        /// The server image ID
        /// </summary>
        [Input("image")]
        public Input<string>? Image { get; set; }

        /// <summary>
        /// The server name
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The server organization ID
        /// </summary>
        [Input("organization")]
        public Input<string>? Organization { get; set; }

        /// <summary>
        /// Placement group ID if server must be part of a placement group
        /// </summary>
        [Input("placement_group")]
        public Input<string>? Placement_group { get; set; }

        /// <summary>
        /// The server project ID
        /// </summary>
        [Input("project")]
        public Input<string>? Project { get; set; }

        /// <summary>
        /// The ID of the reserved IP to attach to the server
        /// </summary>
        [Input("public_ip")]
        public Input<string>? Public_ip { get; set; }

        /// <summary>
        /// The security group ID
        /// </summary>
        [Input("security_group")]
        public Input<string>? Security_group { get; set; }

        [Input("tags")]
        private InputList<string>? _tags;

        /// <summary>
        /// The server tags
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

        [Input("volumes")]
        private InputMap<Inputs.ScalewayInstanceV1VolumeServerTemplateArgs>? _volumes;
        public InputMap<Inputs.ScalewayInstanceV1VolumeServerTemplateArgs> Volumes
        {
            get => _volumes ?? (_volumes = new InputMap<Inputs.ScalewayInstanceV1VolumeServerTemplateArgs>());
            set => _volumes = value;
        }

        /// <summary>
        /// The zone you want to target
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

        public ServerArgs()
        {
            Boot_type = Pulumi.ScalewayInstances.Servers.BootType.Local;
        }
        public static new ServerArgs Empty => new ServerArgs();
    }
}
