<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;
using Pulumi;

namespace luxifer.Scaleway
{
    /// <summary>
    /// Creates and manages Scaleway Load-Balancers.
    /// For more information, see [the documentation](https://developers.scaleway.com/en/products/lb/zoned_api).
    /// 
    /// ## Examples
    /// 
    /// ### Basic
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Scaleway = luxifer.Scaleway;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var main = new Scaleway.LbIp("main", new()
    ///     {
    ///         Zone = "fr-par-1",
    ///     });
    /// 
    ///     var @base = new Scaleway.Lb("base", new()
    ///     {
    ///         IpId = main.Id,
    ///         Zone = main.Zone,
    ///         Type = "LB-S",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ### IP for Public Gateway
    /// resource "scaleway_vpc_public_gateway_ip" "main" {
    /// }
    /// 
    /// ### Scaleway Private Network
    /// resource scaleway_vpc_private_network main {
    /// }
    /// 
    /// ### VPC Public Gateway Network
    /// resource "scaleway_vpc_public_gateway" "main" {
    ///     name  = "tf-test-public-gw"
    ///     type  = "VPC-GW-S"
    ///     ip_id = scaleway_vpc_public_gateway_ip.main.id
    /// }
    /// 
    /// ### VPC Public Gateway Network DHCP config
    /// resource "scaleway_vpc_public_gateway_dhcp" "main" {
    ///     subnet = "10.0.0.0/24"
    /// }
    /// 
    /// ### VPC Gateway Network
    /// resource "scaleway_vpc_gateway_network" "main" {
    ///     gateway_id         = scaleway_vpc_public_gateway.main.id
    ///     private_network_id = scaleway_vpc_private_network.main.id
    ///     dhcp_id            = scaleway_vpc_public_gateway_dhcp.main.id
    ///     cleanup_dhcp       = true
    ///     enable_masquerade  = true
    /// }
    /// 
    /// ### Scaleway Instance
    /// resource "scaleway_instance_server" "main" {
    ///     name        = "Scaleway Terraform Provider"
    ///     type        = "DEV1-S"
    ///     image       = "debian_bullseye"
    ///     enable_ipv6 = false
    /// 
    ///     private_network {
    ///         pn_id = scaleway_vpc_private_network.main.id
    ///     }
    /// }
    /// 
    /// ### IP for LB IP
    /// resource scaleway_lb_ip main {
    /// }
    /// 
    /// ### Scaleway Private Network
    /// resource scaleway_vpc_private_network "main" {
    ///     name = "private network with static config"
    /// }
    /// 
    /// ## Migration
    /// 
    /// In order to migrate to other types you can check the migration up or down via our CLI `scw lb lb-types list`.
    /// this change will not recreate your Load Balancer.
    /// 
    /// Please check our [documentation](https://developers.scaleway.com/en/products/lb/zoned_api/#post-355592) for further details
    /// 
    /// ## IP ID
    /// 
    /// Since v1.15.0, `ip_id` is a required field. This means that now a separate `scaleway.LbIp` is required.
    /// When importing, the IP needs to be imported as well as the LB.
    /// When upgrading to v1.15.0, you will need to create a new `scaleway.LbIp` resource and import it.
    /// 
    /// For instance, if you had the following:
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Scaleway = luxifer.Scaleway;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var main = new Scaleway.Lb("main", new()
    ///     {
    ///         Type = "LB-S",
    ///         Zone = "fr-par-1",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// You will need to update it to:
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Scaleway = luxifer.Scaleway;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var mainLbIp = new Scaleway.LbIp("mainLbIp");
    /// 
    ///     var mainLb = new Scaleway.Lb("mainLb", new()
    ///     {
    ///         IpId = mainLbIp.Id,
    ///         Zone = "fr-par-1",
    ///         Type = "LB-S",
    ///         ReleaseIp = false,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Load-Balancer can be imported using the `{zone}/{id}`, e.g. bash
    /// 
    /// ```sh
    ///  $ pulumi import scaleway:index/lb:Lb main fr-par-1/11111111-1111-1111-1111-111111111111
    /// ```
    /// 
    ///  Be aware that you will also need to import the `scaleway_lb_ip` resource.
    /// </summary>
    [ScalewayResourceType("scaleway:index/lb:Lb")]
    public partial class Lb : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The description of the load-balancer.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// The load-balance public IP Address
        /// </summary>
        [Output("ipAddress")]
        public Output<string> IpAddress { get; private set; } = null!;

        /// <summary>
        /// The ID of the associated LB IP. See below.
        /// </summary>
        [Output("ipId")]
        public Output<string> IpId { get; private set; } = null!;

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

        /// <summary>
        /// The organization ID the load-balancer is associated with.
        /// </summary>
        [Output("organizationId")]
        public Output<string> OrganizationId { get; private set; } = null!;

        /// <summary>
        /// List of private network to connect with your load balancer
        /// </summary>
        [Output("privateNetworks")]
        public Output<ImmutableArray<Outputs.LbPrivateNetwork>> PrivateNetworks { get; private set; } = null!;

        /// <summary>
        /// `project_id`) The ID of the project the load-balancer is associated with.
        /// </summary>
        [Output("projectId")]
        public Output<string> ProjectId { get; private set; } = null!;

        /// <summary>
        /// The region of the resource
        /// </summary>
        [Output("region")]
        public Output<string> Region { get; private set; } = null!;

        /// <summary>
        /// The release_ip allow release the ip address associated with the load-balancers.
        /// </summary>
        [Output("releaseIp")]
        public Output<bool?> ReleaseIp { get; private set; } = null!;

        /// <summary>
        /// Enforces minimal SSL version (in SSL/TLS offloading context). Please check [possible values](https://developers.scaleway.com/en/products/lb/zoned_api/#ssl-compatibility-level-442f99).
        /// </summary>
        [Output("sslCompatibilityLevel")]
        public Output<string?> SslCompatibilityLevel { get; private set; } = null!;

        /// <summary>
        /// The tags associated with the load-balancers.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableArray<string>> Tags { get; private set; } = null!;

        /// <summary>
        /// The type of the load-balancer. Please check the migration section to upgrade the type
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;

        /// <summary>
        /// `zone`) The zone of the load-balancer.
        /// </summary>
        [Output("zone")]
        public Output<string> Zone { get; private set; } = null!;


        /// <summary>
        /// Create a Lb 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 Lb(string name, LbArgs args, CustomResourceOptions? options = null)
            : base("scaleway:index/lb:Lb", name, args ?? new LbArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Lb(string name, Input<string> id, LbState? state = null, CustomResourceOptions? options = null)
            : base("scaleway:index/lb:Lb", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/luxifer/pulumi-scaleway",
            };
            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 Lb 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 Lb Get(string name, Input<string> id, LbState? state = null, CustomResourceOptions? options = null)
        {
            return new Lb(name, id, state, options);
        }
    }

    public sealed class LbArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The description of the load-balancer.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The ID of the associated LB IP. See below.
        /// </summary>
        [Input("ipId", required: true)]
        public Input<string> IpId { get; set; } = null!;

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

        [Input("privateNetworks")]
        private InputList<Inputs.LbPrivateNetworkArgs>? _privateNetworks;

        /// <summary>
        /// List of private network to connect with your load balancer
        /// </summary>
        public InputList<Inputs.LbPrivateNetworkArgs> PrivateNetworks
        {
            get => _privateNetworks ?? (_privateNetworks = new InputList<Inputs.LbPrivateNetworkArgs>());
            set => _privateNetworks = value;
        }

        /// <summary>
        /// `project_id`) The ID of the project the load-balancer is associated with.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// The release_ip allow release the ip address associated with the load-balancers.
        /// </summary>
        [Input("releaseIp")]
        public Input<bool>? ReleaseIp { get; set; }

        /// <summary>
        /// Enforces minimal SSL version (in SSL/TLS offloading context). Please check [possible values](https://developers.scaleway.com/en/products/lb/zoned_api/#ssl-compatibility-level-442f99).
        /// </summary>
        [Input("sslCompatibilityLevel")]
        public Input<string>? SslCompatibilityLevel { get; set; }

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

        /// <summary>
        /// The tags associated with the load-balancers.
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

        /// <summary>
        /// The type of the load-balancer. Please check the migration section to upgrade the type
        /// </summary>
        [Input("type", required: true)]
        public Input<string> Type { get; set; } = null!;

        /// <summary>
        /// `zone`) The zone of the load-balancer.
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

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

    public sealed class LbState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The description of the load-balancer.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The load-balance public IP Address
        /// </summary>
        [Input("ipAddress")]
        public Input<string>? IpAddress { get; set; }

        /// <summary>
        /// The ID of the associated LB IP. See below.
        /// </summary>
        [Input("ipId")]
        public Input<string>? IpId { get; set; }

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

        /// <summary>
        /// The organization ID the load-balancer is associated with.
        /// </summary>
        [Input("organizationId")]
        public Input<string>? OrganizationId { get; set; }

        [Input("privateNetworks")]
        private InputList<Inputs.LbPrivateNetworkGetArgs>? _privateNetworks;

        /// <summary>
        /// List of private network to connect with your load balancer
        /// </summary>
        public InputList<Inputs.LbPrivateNetworkGetArgs> PrivateNetworks
        {
            get => _privateNetworks ?? (_privateNetworks = new InputList<Inputs.LbPrivateNetworkGetArgs>());
            set => _privateNetworks = value;
        }

        /// <summary>
        /// `project_id`) The ID of the project the load-balancer is associated with.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// The region of the resource
        /// </summary>
        [Input("region")]
        public Input<string>? Region { get; set; }

        /// <summary>
        /// The release_ip allow release the ip address associated with the load-balancers.
        /// </summary>
        [Input("releaseIp")]
        public Input<bool>? ReleaseIp { get; set; }

        /// <summary>
        /// Enforces minimal SSL version (in SSL/TLS offloading context). Please check [possible values](https://developers.scaleway.com/en/products/lb/zoned_api/#ssl-compatibility-level-442f99).
        /// </summary>
        [Input("sslCompatibilityLevel")]
        public Input<string>? SslCompatibilityLevel { get; set; }

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

        /// <summary>
        /// The tags associated with the load-balancers.
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

        /// <summary>
        /// The type of the load-balancer. Please check the migration section to upgrade the type
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// `zone`) The zone of the load-balancer.
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

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