// *** 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 Lbrlabs.PulumiPackage.Ovh.CloudProject
{
    /// <summary>
    /// Creates a private network in a public cloud project.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Ovh = Lbrlabs.PulumiPackage.Ovh;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var net = new Ovh.CloudProject.NetworkPrivate("net", new()
    ///     {
    ///         Regions = new[]
    ///         {
    ///             "GRA1",
    ///             "BHS1",
    ///         },
    ///         ServiceName = "XXXXXX",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Private network in a public cloud project can be imported using the `service_name` and the `network_id`, separated by "/" E.g., bash
    /// 
    /// ```sh
    ///  $ pulumi import ovh:CloudProject/networkPrivate:NetworkPrivate mynet ookie9mee8Shaeghaeleeju7Xeghohv6e/pn-12345678
    /// ```
    /// </summary>
    [OvhResourceType("ovh:CloudProject/networkPrivate:NetworkPrivate")]
    public partial class NetworkPrivate : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The name of the network.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// an array of valid OVHcloud public cloud region ID in which the network
        /// will be available. Ex.: "GRA1". Defaults to all public cloud regions.
        /// </summary>
        [Output("regions")]
        public Output<ImmutableArray<string>> Regions { get; private set; } = null!;

        /// <summary>
        /// A map representing information about the region.
        /// * `regions_attributes/region` - The id of the region.
        /// * `regions_attributes/status` - The status of the network in the region.
        /// * `regions_attributes/openstackid` - The private network id in the region.
        /// </summary>
        [Output("regionsAttributes")]
        public Output<ImmutableArray<Outputs.NetworkPrivateRegionsAttribute>> RegionsAttributes { get; private set; } = null!;

        /// <summary>
        /// (Deprecated) A map representing the status of the network per region.
        /// * `regions_status/region` - (Deprecated) The id of the region.
        /// * `regions_status/status` - (Deprecated) The status of the network in the region.
        /// </summary>
        [Output("regionsStatuses")]
        public Output<ImmutableArray<Outputs.NetworkPrivateRegionsStatus>> RegionsStatuses { get; private set; } = null!;

        /// <summary>
        /// The id of the public cloud project. If omitted,
        /// the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
        /// </summary>
        [Output("serviceName")]
        public Output<string> ServiceName { get; private set; } = null!;

        /// <summary>
        /// the status of the network. should be normally set to 'ACTIVE'.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// the type of the network. Either 'private' or 'public'.
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;

        /// <summary>
        /// a vlan id to associate with the network.
        /// Changing this value recreates the resource. Defaults to 0.
        /// </summary>
        [Output("vlanId")]
        public Output<int?> VlanId { get; private set; } = null!;


        /// <summary>
        /// Create a NetworkPrivate 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 NetworkPrivate(string name, NetworkPrivateArgs args, CustomResourceOptions? options = null)
            : base("ovh:CloudProject/networkPrivate:NetworkPrivate", name, args ?? new NetworkPrivateArgs(), MakeResourceOptions(options, ""))
        {
        }

        private NetworkPrivate(string name, Input<string> id, NetworkPrivateState? state = null, CustomResourceOptions? options = null)
            : base("ovh:CloudProject/networkPrivate:NetworkPrivate", 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/lbrlabs",
            };
            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 NetworkPrivate 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 NetworkPrivate Get(string name, Input<string> id, NetworkPrivateState? state = null, CustomResourceOptions? options = null)
        {
            return new NetworkPrivate(name, id, state, options);
        }
    }

    public sealed class NetworkPrivateArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the network.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("regions")]
        private InputList<string>? _regions;

        /// <summary>
        /// an array of valid OVHcloud public cloud region ID in which the network
        /// will be available. Ex.: "GRA1". Defaults to all public cloud regions.
        /// </summary>
        public InputList<string> Regions
        {
            get => _regions ?? (_regions = new InputList<string>());
            set => _regions = value;
        }

        /// <summary>
        /// The id of the public cloud project. If omitted,
        /// the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
        /// </summary>
        [Input("serviceName", required: true)]
        public Input<string> ServiceName { get; set; } = null!;

        /// <summary>
        /// a vlan id to associate with the network.
        /// Changing this value recreates the resource. Defaults to 0.
        /// </summary>
        [Input("vlanId")]
        public Input<int>? VlanId { get; set; }

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

    public sealed class NetworkPrivateState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the network.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("regions")]
        private InputList<string>? _regions;

        /// <summary>
        /// an array of valid OVHcloud public cloud region ID in which the network
        /// will be available. Ex.: "GRA1". Defaults to all public cloud regions.
        /// </summary>
        public InputList<string> Regions
        {
            get => _regions ?? (_regions = new InputList<string>());
            set => _regions = value;
        }

        [Input("regionsAttributes")]
        private InputList<Inputs.NetworkPrivateRegionsAttributeGetArgs>? _regionsAttributes;

        /// <summary>
        /// A map representing information about the region.
        /// * `regions_attributes/region` - The id of the region.
        /// * `regions_attributes/status` - The status of the network in the region.
        /// * `regions_attributes/openstackid` - The private network id in the region.
        /// </summary>
        public InputList<Inputs.NetworkPrivateRegionsAttributeGetArgs> RegionsAttributes
        {
            get => _regionsAttributes ?? (_regionsAttributes = new InputList<Inputs.NetworkPrivateRegionsAttributeGetArgs>());
            set => _regionsAttributes = value;
        }

        [Input("regionsStatuses")]
        private InputList<Inputs.NetworkPrivateRegionsStatusGetArgs>? _regionsStatuses;

        /// <summary>
        /// (Deprecated) A map representing the status of the network per region.
        /// * `regions_status/region` - (Deprecated) The id of the region.
        /// * `regions_status/status` - (Deprecated) The status of the network in the region.
        /// </summary>
        [Obsolete(@"use the regions_attributes field instead")]
        public InputList<Inputs.NetworkPrivateRegionsStatusGetArgs> RegionsStatuses
        {
            get => _regionsStatuses ?? (_regionsStatuses = new InputList<Inputs.NetworkPrivateRegionsStatusGetArgs>());
            set => _regionsStatuses = value;
        }

        /// <summary>
        /// The id of the public cloud project. If omitted,
        /// the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
        /// </summary>
        [Input("serviceName")]
        public Input<string>? ServiceName { get; set; }

        /// <summary>
        /// the status of the network. should be normally set to 'ACTIVE'.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// the type of the network. Either 'private' or 'public'.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// a vlan id to associate with the network.
        /// Changing this value recreates the resource. Defaults to 0.
        /// </summary>
        [Input("vlanId")]
        public Input<int>? VlanId { get; set; }

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