// *** 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.Ecs
{
    /// <summary>
    /// Provides a ECS Network Interface Attachment resource.
    /// 
    /// For information about ECS Network Interface Attachment and how to use it, see [What is Network Interface Attachment](https://www.alibabacloud.com/help/en/doc-detail/58515.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.123.1+.
    /// 
    /// ## 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-testAcc";
    ///     var defaultZones = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = "Instance",
    ///     });
    /// 
    ///     var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    ///     {
    ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         EniAmount = 3,
    ///     });
    /// 
    ///     var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    ///     {
    ///         VpcName = name,
    ///         CidrBlock = "192.168.0.0/24",
    ///     });
    /// 
    ///     var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
    ///     {
    ///         VswitchName = name,
    ///         CidrBlock = "192.168.0.0/24",
    ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         VpcId = defaultNetwork.Id,
    ///     });
    /// 
    ///     var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
    ///     {
    ///         Description = "New security group",
    ///         VpcId = defaultNetwork.Id,
    ///     });
    /// 
    ///     var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
    ///     {
    ///         NameRegex = "^ubuntu_[0-9]+_[0-9]+_x64*",
    ///         MostRecent = true,
    ///         Owners = "system",
    ///     });
    /// 
    ///     var defaultInstance = new AliCloud.Ecs.Instance("defaultInstance", new()
    ///     {
    ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         InstanceName = name,
    ///         HostName = "tf-testAcc",
    ///         ImageId = defaultImages.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.InstanceTypes[0]?.Id),
    ///         SecurityGroups = new[]
    ///         {
    ///             defaultSecurityGroup.Id,
    ///         },
    ///         VswitchId = defaultSwitch.Id,
    ///     });
    /// 
    ///     var defaultResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke(new()
    ///     {
    ///         Status = "OK",
    ///     });
    /// 
    ///     var defaultEcsNetworkInterface = new AliCloud.Ecs.EcsNetworkInterface("defaultEcsNetworkInterface", new()
    ///     {
    ///         NetworkInterfaceName = name,
    ///         VswitchId = defaultSwitch.Id,
    ///         SecurityGroupIds = new[]
    ///         {
    ///             defaultSecurityGroup.Id,
    ///         },
    ///         Description = "Basic test",
    ///         PrimaryIpAddress = "192.168.0.2",
    ///         Tags = 
    ///         {
    ///             { "Created", "TF" },
    ///             { "For", "Test" },
    ///         },
    ///         ResourceGroupId = defaultResourceGroups.Apply(getResourceGroupsResult =&gt; getResourceGroupsResult.Ids[0]),
    ///     });
    /// 
    ///     var defaultEcsNetworkInterfaceAttachment = new AliCloud.Ecs.EcsNetworkInterfaceAttachment("defaultEcsNetworkInterfaceAttachment", new()
    ///     {
    ///         NetworkInterfaceId = defaultEcsNetworkInterface.Id,
    ///         InstanceId = defaultInstance.Id,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ECS Network Interface Attachment can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ecs/ecsNetworkInterfaceAttachment:EcsNetworkInterfaceAttachment example eni-abcd1234:i-abcd1234
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ecs/ecsNetworkInterfaceAttachment:EcsNetworkInterfaceAttachment")]
    public partial class EcsNetworkInterfaceAttachment : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The instance id.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The network interface id.
        /// </summary>
        [Output("networkInterfaceId")]
        public Output<string> NetworkInterfaceId { get; private set; } = null!;

        /// <summary>
        /// The trunk network instance id.
        /// </summary>
        [Output("trunkNetworkInstanceId")]
        public Output<string?> TrunkNetworkInstanceId { get; private set; } = null!;

        /// <summary>
        /// The wait for network configuration ready.
        /// </summary>
        [Output("waitForNetworkConfigurationReady")]
        public Output<bool?> WaitForNetworkConfigurationReady { get; private set; } = null!;


        /// <summary>
        /// Create a EcsNetworkInterfaceAttachment 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 EcsNetworkInterfaceAttachment(string name, EcsNetworkInterfaceAttachmentArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ecs/ecsNetworkInterfaceAttachment:EcsNetworkInterfaceAttachment", name, args ?? new EcsNetworkInterfaceAttachmentArgs(), MakeResourceOptions(options, ""))
        {
        }

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

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

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

        /// <summary>
        /// The trunk network instance id.
        /// </summary>
        [Input("trunkNetworkInstanceId")]
        public Input<string>? TrunkNetworkInstanceId { get; set; }

        /// <summary>
        /// The wait for network configuration ready.
        /// </summary>
        [Input("waitForNetworkConfigurationReady")]
        public Input<bool>? WaitForNetworkConfigurationReady { get; set; }

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

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

        /// <summary>
        /// The network interface id.
        /// </summary>
        [Input("networkInterfaceId")]
        public Input<string>? NetworkInterfaceId { get; set; }

        /// <summary>
        /// The trunk network instance id.
        /// </summary>
        [Input("trunkNetworkInstanceId")]
        public Input<string>? TrunkNetworkInstanceId { get; set; }

        /// <summary>
        /// The wait for network configuration ready.
        /// </summary>
        [Input("waitForNetworkConfigurationReady")]
        public Input<bool>? WaitForNetworkConfigurationReady { get; set; }

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