// *** 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
{
    public static class GetNetworkInterfaces
    {
        /// <summary>
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```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") ?? "networkInterfacesName";
        ///     var vpc = new AliCloud.Vpc.Network("vpc", new()
        ///     {
        ///         CidrBlock = "192.168.0.0/24",
        ///         VpcName = name,
        ///     });
        /// 
        ///     var defaultZones = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableResourceCreation = "VSwitch",
        ///     });
        /// 
        ///     var vswitch = new AliCloud.Vpc.Switch("vswitch", new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         CidrBlock = "192.168.0.0/24",
        ///         VpcId = vpc.Id,
        ///         VswitchName = name,
        ///     });
        /// 
        ///     var @group = new AliCloud.Ecs.SecurityGroup("group", new()
        ///     {
        ///         VpcId = vpc.Id,
        ///     });
        /// 
        ///     var @interface = new AliCloud.Vpc.NetworkInterface("interface", new()
        ///     {
        ///         Description = "Basic test",
        ///         PrivateIp = "192.168.0.2",
        ///         SecurityGroups = new[]
        ///         {
        ///             @group.Id,
        ///         },
        ///         Tags = 
        ///         {
        ///             { "TF-VER", "0.11.3" },
        ///         },
        ///         VswitchId = vswitch.Id,
        ///     });
        /// 
        ///     var instance = new AliCloud.Ecs.Instance("instance", new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         ImageId = "centos_7_04_64_20G_alibase_201701015.vhd",
        ///         InstanceName = name,
        ///         InstanceType = "ecs.e3.xlarge",
        ///         InternetMaxBandwidthOut = 10,
        ///         SecurityGroups = new[]
        ///         {
        ///             @group.Id,
        ///         },
        ///         SystemDiskCategory = "cloud_efficiency",
        ///         VswitchId = vswitch.Id,
        ///     });
        /// 
        ///     var attachment = new AliCloud.Vpc.NetworkInterfaceAttachment("attachment", new()
        ///     {
        ///         InstanceId = instance.Id,
        ///         NetworkInterfaceId = @interface.Id,
        ///     });
        /// 
        ///     var defaultNetworkInterfaces = AliCloud.Ecs.GetNetworkInterfaces.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             attachment.NetworkInterfaceId,
        ///         },
        ///         InstanceId = instance.Id,
        ///         NameRegex = name,
        ///         PrivateIp = "192.168.0.2",
        ///         SecurityGroupId = @group.Id,
        ///         Tags = 
        ///         {
        ///             { "TF-VER", "0.11.3" },
        ///         },
        ///         Type = "Secondary",
        ///         VpcId = vpc.Id,
        ///         VswitchId = vswitch.Id,
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["eni0Name"] = defaultNetworkInterfaces.Apply(getNetworkInterfacesResult =&gt; getNetworkInterfacesResult.Interfaces[0]?.Name),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// ##  Argument Reference
        /// 
        /// The following arguments are supported:
        /// 
        /// * `ids` - (Optional)  A list of ENI IDs.
        /// * `name_regex` - (Optional) A regex string to filter results by ENI name.
        /// * `vpc_id` - (Optional) The VPC ID linked to ENIs.
        /// * `vswitch_id` - (Optional) The VSwitch ID linked to ENIs.
        /// * `private_ip` - (Optional) The primary private IP address of the ENI.
        /// * `security_group_id` - (Optional) The security group ID linked to ENIs.
        /// * `name` - (Optional) The name of the ENIs.
        /// * `type` - (Optional) The type of ENIs, Only support for "Primary" or "Secondary".
        /// * `instance_id` - (Optional) The ECS instance ID that the ENI is attached to.
        /// * `tags` - (Optional) A map of tags assigned to ENIs.
        /// * `output_file` - (Optional) The name of output file that saves the filter results.
        /// * `resource_group_id` - (Optional, ForceNew, Available in 1.57.0+) The Id of resource group which the network interface belongs.
        /// </summary>
        public static Task<GetNetworkInterfacesResult> InvokeAsync(GetNetworkInterfacesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetNetworkInterfacesResult>("alicloud:ecs/getNetworkInterfaces:getNetworkInterfaces", args ?? new GetNetworkInterfacesArgs(), options.WithDefaults());

        /// <summary>
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```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") ?? "networkInterfacesName";
        ///     var vpc = new AliCloud.Vpc.Network("vpc", new()
        ///     {
        ///         CidrBlock = "192.168.0.0/24",
        ///         VpcName = name,
        ///     });
        /// 
        ///     var defaultZones = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableResourceCreation = "VSwitch",
        ///     });
        /// 
        ///     var vswitch = new AliCloud.Vpc.Switch("vswitch", new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         CidrBlock = "192.168.0.0/24",
        ///         VpcId = vpc.Id,
        ///         VswitchName = name,
        ///     });
        /// 
        ///     var @group = new AliCloud.Ecs.SecurityGroup("group", new()
        ///     {
        ///         VpcId = vpc.Id,
        ///     });
        /// 
        ///     var @interface = new AliCloud.Vpc.NetworkInterface("interface", new()
        ///     {
        ///         Description = "Basic test",
        ///         PrivateIp = "192.168.0.2",
        ///         SecurityGroups = new[]
        ///         {
        ///             @group.Id,
        ///         },
        ///         Tags = 
        ///         {
        ///             { "TF-VER", "0.11.3" },
        ///         },
        ///         VswitchId = vswitch.Id,
        ///     });
        /// 
        ///     var instance = new AliCloud.Ecs.Instance("instance", new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         ImageId = "centos_7_04_64_20G_alibase_201701015.vhd",
        ///         InstanceName = name,
        ///         InstanceType = "ecs.e3.xlarge",
        ///         InternetMaxBandwidthOut = 10,
        ///         SecurityGroups = new[]
        ///         {
        ///             @group.Id,
        ///         },
        ///         SystemDiskCategory = "cloud_efficiency",
        ///         VswitchId = vswitch.Id,
        ///     });
        /// 
        ///     var attachment = new AliCloud.Vpc.NetworkInterfaceAttachment("attachment", new()
        ///     {
        ///         InstanceId = instance.Id,
        ///         NetworkInterfaceId = @interface.Id,
        ///     });
        /// 
        ///     var defaultNetworkInterfaces = AliCloud.Ecs.GetNetworkInterfaces.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             attachment.NetworkInterfaceId,
        ///         },
        ///         InstanceId = instance.Id,
        ///         NameRegex = name,
        ///         PrivateIp = "192.168.0.2",
        ///         SecurityGroupId = @group.Id,
        ///         Tags = 
        ///         {
        ///             { "TF-VER", "0.11.3" },
        ///         },
        ///         Type = "Secondary",
        ///         VpcId = vpc.Id,
        ///         VswitchId = vswitch.Id,
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["eni0Name"] = defaultNetworkInterfaces.Apply(getNetworkInterfacesResult =&gt; getNetworkInterfacesResult.Interfaces[0]?.Name),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// ##  Argument Reference
        /// 
        /// The following arguments are supported:
        /// 
        /// * `ids` - (Optional)  A list of ENI IDs.
        /// * `name_regex` - (Optional) A regex string to filter results by ENI name.
        /// * `vpc_id` - (Optional) The VPC ID linked to ENIs.
        /// * `vswitch_id` - (Optional) The VSwitch ID linked to ENIs.
        /// * `private_ip` - (Optional) The primary private IP address of the ENI.
        /// * `security_group_id` - (Optional) The security group ID linked to ENIs.
        /// * `name` - (Optional) The name of the ENIs.
        /// * `type` - (Optional) The type of ENIs, Only support for "Primary" or "Secondary".
        /// * `instance_id` - (Optional) The ECS instance ID that the ENI is attached to.
        /// * `tags` - (Optional) A map of tags assigned to ENIs.
        /// * `output_file` - (Optional) The name of output file that saves the filter results.
        /// * `resource_group_id` - (Optional, ForceNew, Available in 1.57.0+) The Id of resource group which the network interface belongs.
        /// </summary>
        public static Output<GetNetworkInterfacesResult> Invoke(GetNetworkInterfacesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetNetworkInterfacesResult>("alicloud:ecs/getNetworkInterfaces:getNetworkInterfaces", args ?? new GetNetworkInterfacesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetNetworkInterfacesArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private List<string>? _ids;
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

        /// <summary>
        /// ID of the instance that the ENI is attached to.
        /// </summary>
        [Input("instanceId")]
        public string? InstanceId { get; set; }

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

        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        [Input("networkInterfaceName")]
        public string? NetworkInterfaceName { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        [Input("primaryIpAddress")]
        public string? PrimaryIpAddress { get; set; }

        /// <summary>
        /// Primary private IP of the ENI.
        /// </summary>
        [Input("privateIp")]
        public string? PrivateIp { get; set; }

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

        [Input("securityGroupId")]
        public string? SecurityGroupId { get; set; }

        [Input("serviceManaged")]
        public bool? ServiceManaged { get; set; }

        /// <summary>
        /// Current status of the ENI.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// A map of tags assigned to the ENI.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

        [Input("type")]
        public string? Type { get; set; }

        /// <summary>
        /// ID of the VPC that the ENI belongs to.
        /// </summary>
        [Input("vpcId")]
        public string? VpcId { get; set; }

        /// <summary>
        /// ID of the VSwitch that the ENI is linked to.
        /// </summary>
        [Input("vswitchId")]
        public string? VswitchId { get; set; }

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

    public sealed class GetNetworkInterfacesInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private InputList<string>? _ids;
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

        /// <summary>
        /// ID of the instance that the ENI is attached to.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

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

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

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

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

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

        /// <summary>
        /// Primary private IP of the ENI.
        /// </summary>
        [Input("privateIp")]
        public Input<string>? PrivateIp { get; set; }

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

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

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

        /// <summary>
        /// Current status of the ENI.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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

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

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

        /// <summary>
        /// ID of the VPC that the ENI belongs to.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        /// <summary>
        /// ID of the VSwitch that the ENI is linked to.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

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


    [OutputType]
    public sealed class GetNetworkInterfacesResult
    {
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        /// <summary>
        /// ID of the instance that the ENI is attached to.
        /// </summary>
        public readonly string? InstanceId;
        /// <summary>
        /// A list of ENIs. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetNetworkInterfacesInterfaceResult> Interfaces;
        /// <summary>
        /// Name of the ENI.
        /// </summary>
        public readonly string? Name;
        public readonly string? NameRegex;
        public readonly ImmutableArray<string> Names;
        public readonly string? NetworkInterfaceName;
        public readonly string? OutputFile;
        public readonly string? PrimaryIpAddress;
        /// <summary>
        /// Primary private IP of the ENI.
        /// </summary>
        public readonly string? PrivateIp;
        /// <summary>
        /// The Id of resource group.
        /// </summary>
        public readonly string? ResourceGroupId;
        public readonly string? SecurityGroupId;
        public readonly bool? ServiceManaged;
        /// <summary>
        /// Current status of the ENI.
        /// </summary>
        public readonly string? Status;
        /// <summary>
        /// A map of tags assigned to the ENI.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;
        public readonly string? Type;
        /// <summary>
        /// ID of the VPC that the ENI belongs to.
        /// </summary>
        public readonly string? VpcId;
        /// <summary>
        /// ID of the VSwitch that the ENI is linked to.
        /// </summary>
        public readonly string? VswitchId;

        [OutputConstructor]
        private GetNetworkInterfacesResult(
            string id,

            ImmutableArray<string> ids,

            string? instanceId,

            ImmutableArray<Outputs.GetNetworkInterfacesInterfaceResult> interfaces,

            string? name,

            string? nameRegex,

            ImmutableArray<string> names,

            string? networkInterfaceName,

            string? outputFile,

            string? primaryIpAddress,

            string? privateIp,

            string? resourceGroupId,

            string? securityGroupId,

            bool? serviceManaged,

            string? status,

            ImmutableDictionary<string, object>? tags,

            string? type,

            string? vpcId,

            string? vswitchId)
        {
            Id = id;
            Ids = ids;
            InstanceId = instanceId;
            Interfaces = interfaces;
            Name = name;
            NameRegex = nameRegex;
            Names = names;
            NetworkInterfaceName = networkInterfaceName;
            OutputFile = outputFile;
            PrimaryIpAddress = primaryIpAddress;
            PrivateIp = privateIp;
            ResourceGroupId = resourceGroupId;
            SecurityGroupId = securityGroupId;
            ServiceManaged = serviceManaged;
            Status = status;
            Tags = tags;
            Type = type;
            VpcId = vpcId;
            VswitchId = vswitchId;
        }
    }
}
