// *** 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.Eci
{
    /// <summary>
    /// Provides a ECI Virtual Node resource.
    /// 
    /// For information about ECI Virtual Node and how to use it, see [What is Virtual Node](https://www.alibabacloud.com/help/en/doc-detail/89129.html).
    /// 
    /// &gt; **NOTE:** Available in v1.145.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "tf-testaccvirtualnode";
    ///     var defaultZones = AliCloud.Eci.GetZones.Invoke();
    /// 
    ///     var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
    ///     {
    ///         NameRegex = "default-NODELETING",
    ///     });
    /// 
    ///     var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
    ///     {
    ///         VpcId = defaultNetworks.Apply(getNetworksResult =&gt; getNetworksResult.Ids[0]),
    ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.ZoneIds[1]),
    ///     });
    /// 
    ///     var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
    ///     {
    ///         VpcId = defaultNetworks.Apply(getNetworksResult =&gt; getNetworksResult.Ids[0]),
    ///     });
    /// 
    ///     var defaultEipAddress = new AliCloud.Ecs.EipAddress("defaultEipAddress", new()
    ///     {
    ///         AddressName = name,
    ///     });
    /// 
    ///     var defaultResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    /// 
    ///     var defaultVirtualNode = new AliCloud.Eci.VirtualNode("defaultVirtualNode", new()
    ///     {
    ///         SecurityGroupId = defaultSecurityGroup.Id,
    ///         VirtualNodeName = name,
    ///         VswitchId = defaultSwitches.Apply(getSwitchesResult =&gt; getSwitchesResult.Ids[1]),
    ///         EnablePublicNetwork = false,
    ///         EipInstanceId = defaultEipAddress.Id,
    ///         ResourceGroupId = defaultResourceGroups.Apply(getResourceGroupsResult =&gt; getResourceGroupsResult.Groups[0]?.Id),
    ///         KubeConfig = "kube config",
    ///         Tags = 
    ///         {
    ///             { "Created", "TF" },
    ///         },
    ///         Taints = new[]
    ///         {
    ///             new AliCloud.Eci.Inputs.VirtualNodeTaintArgs
    ///             {
    ///                 Effect = "NoSchedule",
    ///                 Key = "Tf1",
    ///                 Value = "Test1",
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ECI Virtual Node can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:eci/virtualNode:VirtualNode example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:eci/virtualNode:VirtualNode")]
    public partial class VirtualNode : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The Id of eip.
        /// </summary>
        [Output("eipInstanceId")]
        public Output<string> EipInstanceId { get; private set; } = null!;

        /// <summary>
        /// Whether to enable public network. **NOTE:** If `eip_instance_id` is not configured and `enable_public_network` is true, the system will create an elastic public network IP.
        /// </summary>
        [Output("enablePublicNetwork")]
        public Output<bool?> EnablePublicNetwork { get; private set; } = null!;

        /// <summary>
        /// The kube config for the k8s cluster. It needs to be connected after Base64 encoding.
        /// </summary>
        [Output("kubeConfig")]
        public Output<string> KubeConfig { get; private set; } = null!;

        /// <summary>
        /// The resource group ID.
        /// </summary>
        [Output("resourceGroupId")]
        public Output<string?> ResourceGroupId { get; private set; } = null!;

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

        /// <summary>
        /// The Status of the virtual node. Valid values: `Cleaned`, `Failed`, `Pending`, `Ready`.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;

        /// <summary>
        /// The taint. See the following `Block taints`.
        /// </summary>
        [Output("taints")]
        public Output<ImmutableArray<Outputs.VirtualNodeTaint>> Taints { get; private set; } = null!;

        /// <summary>
        /// The name of the virtual node. The length of the name is limited to `2` to `128` characters. It can contain uppercase and lowercase letters, Chinese characters, numbers, half-width colon (:), underscores (_), or hyphens (-), and must start with letters.
        /// </summary>
        [Output("virtualNodeName")]
        public Output<string?> VirtualNodeName { get; private set; } = null!;

        /// <summary>
        /// The vswitch id.
        /// </summary>
        [Output("vswitchId")]
        public Output<string> VswitchId { get; private set; } = null!;

        /// <summary>
        /// The Zone.
        /// </summary>
        [Output("zoneId")]
        public Output<string> ZoneId { get; private set; } = null!;


        /// <summary>
        /// Create a VirtualNode 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 VirtualNode(string name, VirtualNodeArgs args, CustomResourceOptions? options = null)
            : base("alicloud:eci/virtualNode:VirtualNode", name, args ?? new VirtualNodeArgs(), MakeResourceOptions(options, ""))
        {
        }

        private VirtualNode(string name, Input<string> id, VirtualNodeState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:eci/virtualNode:VirtualNode", 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/rhysmdnz/pulumi-alicloud",
            };
            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 VirtualNode 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 VirtualNode Get(string name, Input<string> id, VirtualNodeState? state = null, CustomResourceOptions? options = null)
        {
            return new VirtualNode(name, id, state, options);
        }
    }

    public sealed class VirtualNodeArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Id of eip.
        /// </summary>
        [Input("eipInstanceId")]
        public Input<string>? EipInstanceId { get; set; }

        /// <summary>
        /// Whether to enable public network. **NOTE:** If `eip_instance_id` is not configured and `enable_public_network` is true, the system will create an elastic public network IP.
        /// </summary>
        [Input("enablePublicNetwork")]
        public Input<bool>? EnablePublicNetwork { get; set; }

        /// <summary>
        /// The kube config for the k8s cluster. It needs to be connected after Base64 encoding.
        /// </summary>
        [Input("kubeConfig", required: true)]
        public Input<string> KubeConfig { get; set; } = null!;

        /// <summary>
        /// The resource group ID.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The security group ID.
        /// </summary>
        [Input("securityGroupId", required: true)]
        public Input<string> SecurityGroupId { get; set; } = null!;

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        [Input("taints")]
        private InputList<Inputs.VirtualNodeTaintArgs>? _taints;

        /// <summary>
        /// The taint. See the following `Block taints`.
        /// </summary>
        public InputList<Inputs.VirtualNodeTaintArgs> Taints
        {
            get => _taints ?? (_taints = new InputList<Inputs.VirtualNodeTaintArgs>());
            set => _taints = value;
        }

        /// <summary>
        /// The name of the virtual node. The length of the name is limited to `2` to `128` characters. It can contain uppercase and lowercase letters, Chinese characters, numbers, half-width colon (:), underscores (_), or hyphens (-), and must start with letters.
        /// </summary>
        [Input("virtualNodeName")]
        public Input<string>? VirtualNodeName { get; set; }

        /// <summary>
        /// The vswitch id.
        /// </summary>
        [Input("vswitchId", required: true)]
        public Input<string> VswitchId { get; set; } = null!;

        /// <summary>
        /// The Zone.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

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

    public sealed class VirtualNodeState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Id of eip.
        /// </summary>
        [Input("eipInstanceId")]
        public Input<string>? EipInstanceId { get; set; }

        /// <summary>
        /// Whether to enable public network. **NOTE:** If `eip_instance_id` is not configured and `enable_public_network` is true, the system will create an elastic public network IP.
        /// </summary>
        [Input("enablePublicNetwork")]
        public Input<bool>? EnablePublicNetwork { get; set; }

        /// <summary>
        /// The kube config for the k8s cluster. It needs to be connected after Base64 encoding.
        /// </summary>
        [Input("kubeConfig")]
        public Input<string>? KubeConfig { get; set; }

        /// <summary>
        /// The resource group ID.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

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

        /// <summary>
        /// The Status of the virtual node. Valid values: `Cleaned`, `Failed`, `Pending`, `Ready`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        [Input("taints")]
        private InputList<Inputs.VirtualNodeTaintGetArgs>? _taints;

        /// <summary>
        /// The taint. See the following `Block taints`.
        /// </summary>
        public InputList<Inputs.VirtualNodeTaintGetArgs> Taints
        {
            get => _taints ?? (_taints = new InputList<Inputs.VirtualNodeTaintGetArgs>());
            set => _taints = value;
        }

        /// <summary>
        /// The name of the virtual node. The length of the name is limited to `2` to `128` characters. It can contain uppercase and lowercase letters, Chinese characters, numbers, half-width colon (:), underscores (_), or hyphens (-), and must start with letters.
        /// </summary>
        [Input("virtualNodeName")]
        public Input<string>? VirtualNodeName { get; set; }

        /// <summary>
        /// The vswitch id.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// The Zone.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

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