<filename>sdk/dotnet/Vpc/NetworkInterfaceAttachment.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.AliCloud.Vpc
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// Bacis Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "networkInterfaceAttachment";
    ///     var number = config.Get("number") ?? "2";
    ///     var vpc = new AliCloud.Vpc.Network("vpc", new()
    ///     {
    ///         CidrBlock = "192.168.0.0/24",
    ///     });
    /// 
    ///     var defaultZones = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = "VSwitch",
    ///     });
    /// 
    ///     var vswitch = new AliCloud.Vpc.Switch("vswitch", new()
    ///     {
    ///         VswitchName = name,
    ///         CidrBlock = "192.168.0.0/24",
    ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         VpcId = vpc.Id,
    ///     });
    /// 
    ///     var @group = new AliCloud.Ecs.SecurityGroup("group", new()
    ///     {
    ///         VpcId = vpc.Id,
    ///     });
    /// 
    ///     var instanceType = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    ///     {
    ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         EniAmount = 2,
    ///     });
    /// 
    ///     var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
    ///     {
    ///         NameRegex = "^ubuntu_18.*64",
    ///         MostRecent = true,
    ///         Owners = "system",
    ///     });
    /// 
    ///     var instance = new List&lt;AliCloud.Ecs.Instance&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; number; rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         instance.Add(new AliCloud.Ecs.Instance($"instance-{range.Value}", new()
    ///         {
    ///             AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///             SecurityGroups = new[]
    ///             {
    ///                 @group.Id,
    ///             },
    ///             InstanceType = instanceType.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.InstanceTypes[0]?.Id),
    ///             SystemDiskCategory = "cloud_efficiency",
    ///             ImageId = defaultImages.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
    ///             InstanceName = name,
    ///             VswitchId = vswitch.Id,
    ///             InternetMaxBandwidthOut = 10,
    ///         }));
    ///     }
    ///     var @interface = new List&lt;AliCloud.Vpc.NetworkInterface&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; number; rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         @interface.Add(new AliCloud.Vpc.NetworkInterface($"interface-{range.Value}", new()
    ///         {
    ///             VswitchId = vswitch.Id,
    ///             SecurityGroups = new[]
    ///             {
    ///                 @group.Id,
    ///             },
    ///         }));
    ///     }
    ///     var attachment = new List&lt;AliCloud.Vpc.NetworkInterfaceAttachment&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; number; rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         attachment.Add(new AliCloud.Vpc.NetworkInterfaceAttachment($"attachment-{range.Value}", new()
    ///         {
    ///             InstanceId = instance.Select(__item =&gt; __item.Id).ToList()[range.Index],
    ///             NetworkInterfaceId = @interface.Select(__item =&gt; __item.Id).ToList()[range.Index],
    ///         }));
    ///     }
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Network Interfaces Attachment resource can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:vpc/networkInterfaceAttachment:NetworkInterfaceAttachment eni eni-abc123456789000:i-abc123456789000
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:vpc/networkInterfaceAttachment:NetworkInterfaceAttachment")]
    public partial class NetworkInterfaceAttachment : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The instance ID to attach.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The ENI ID to attach.
        /// </summary>
        [Output("networkInterfaceId")]
        public Output<string> NetworkInterfaceId { get; private set; } = null!;

        [Output("trunkNetworkInstanceId")]
        public Output<string?> TrunkNetworkInstanceId { get; private set; } = null!;

        [Output("waitForNetworkConfigurationReady")]
        public Output<bool?> WaitForNetworkConfigurationReady { get; private set; } = null!;


        /// <summary>
        /// Create a NetworkInterfaceAttachment 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 NetworkInterfaceAttachment(string name, NetworkInterfaceAttachmentArgs args, CustomResourceOptions? options = null)
            : base("alicloud:vpc/networkInterfaceAttachment:NetworkInterfaceAttachment", name, args ?? new NetworkInterfaceAttachmentArgs(), MakeResourceOptions(options, ""))
        {
        }

        private NetworkInterfaceAttachment(string name, Input<string> id, NetworkInterfaceAttachmentState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:vpc/networkInterfaceAttachment:NetworkInterfaceAttachment", 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 NetworkInterfaceAttachment 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 NetworkInterfaceAttachment Get(string name, Input<string> id, NetworkInterfaceAttachmentState? state = null, CustomResourceOptions? options = null)
        {
            return new NetworkInterfaceAttachment(name, id, state, options);
        }
    }

    public sealed class NetworkInterfaceAttachmentArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The instance ID to attach.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The ENI ID to attach.
        /// </summary>
        [Input("networkInterfaceId", required: true)]
        public Input<string> NetworkInterfaceId { get; set; } = null!;

        [Input("trunkNetworkInstanceId")]
        public Input<string>? TrunkNetworkInstanceId { get; set; }

        [Input("waitForNetworkConfigurationReady")]
        public Input<bool>? WaitForNetworkConfigurationReady { get; set; }

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

    public sealed class NetworkInterfaceAttachmentState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The instance ID to attach.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The ENI ID to attach.
        /// </summary>
        [Input("networkInterfaceId")]
        public Input<string>? NetworkInterfaceId { get; set; }

        [Input("trunkNetworkInstanceId")]
        public Input<string>? TrunkNetworkInstanceId { get; set; }

        [Input("waitForNetworkConfigurationReady")]
        public Input<bool>? WaitForNetworkConfigurationReady { get; set; }

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