1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. NetworkInterface
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.vpc.NetworkInterface

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    DEPRECATED: This resource has been renamed to alicloud.ecs.EcsNetworkInterface from version 1.123.1.

    Provides an ECS Elastic Network Interface resource.

    For information about Elastic Network Interface and how to use it, see Elastic Network Interface.

    NOTE Only one of private_ips or private_ips_count can be specified when assign private IPs.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "networkInterfaceName";
    const vpc = new alicloud.vpc.Network("vpc", {
        vpcName: name,
        cidrBlock: "192.168.0.0/24",
    });
    const default = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const vswitch = new alicloud.vpc.Switch("vswitch", {
        name: name,
        cidrBlock: "192.168.0.0/24",
        zoneId: _default.then(_default => _default.zones?.[0]?.id),
        vpcId: vpc.id,
    });
    const group = new alicloud.ecs.SecurityGroup("group", {
        name: name,
        vpcId: vpc.id,
    });
    const defaultNetworkInterface = new alicloud.vpc.NetworkInterface("default", {
        networkInterfaceName: name,
        vswitchId: vswitch.id,
        securityGroupIds: [group.id],
        privateIp: "192.168.0.2",
        privateIpsCount: 3,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "networkInterfaceName"
    vpc = alicloud.vpc.Network("vpc",
        vpc_name=name,
        cidr_block="192.168.0.0/24")
    default = alicloud.get_zones(available_resource_creation="VSwitch")
    vswitch = alicloud.vpc.Switch("vswitch",
        name=name,
        cidr_block="192.168.0.0/24",
        zone_id=default.zones[0].id,
        vpc_id=vpc.id)
    group = alicloud.ecs.SecurityGroup("group",
        name=name,
        vpc_id=vpc.id)
    default_network_interface = alicloud.vpc.NetworkInterface("default",
        network_interface_name=name,
        vswitch_id=vswitch.id,
        security_group_ids=[group.id],
        private_ip="192.168.0.2",
        private_ips_count=3)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "networkInterfaceName"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("192.168.0.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vswitch, err := vpc.NewSwitch(ctx, "vswitch", &vpc.SwitchArgs{
    			Name:      pulumi.String(name),
    			CidrBlock: pulumi.String("192.168.0.0/24"),
    			ZoneId:    pulumi.String(_default.Zones[0].Id),
    			VpcId:     vpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		group, err := ecs.NewSecurityGroup(ctx, "group", &ecs.SecurityGroupArgs{
    			Name:  pulumi.String(name),
    			VpcId: vpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewNetworkInterface(ctx, "default", &vpc.NetworkInterfaceArgs{
    			NetworkInterfaceName: pulumi.String(name),
    			VswitchId:            vswitch.ID(),
    			SecurityGroupIds: pulumi.StringArray{
    				group.ID(),
    			},
    			PrivateIp:       pulumi.String("192.168.0.2"),
    			PrivateIpsCount: pulumi.Int(3),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "networkInterfaceName";
        var vpc = new AliCloud.Vpc.Network("vpc", new()
        {
            VpcName = name,
            CidrBlock = "192.168.0.0/24",
        });
    
        var @default = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var vswitch = new AliCloud.Vpc.Switch("vswitch", new()
        {
            Name = name,
            CidrBlock = "192.168.0.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
            VpcId = vpc.Id,
        });
    
        var @group = new AliCloud.Ecs.SecurityGroup("group", new()
        {
            Name = name,
            VpcId = vpc.Id,
        });
    
        var defaultNetworkInterface = new AliCloud.Vpc.NetworkInterface("default", new()
        {
            NetworkInterfaceName = name,
            VswitchId = vswitch.Id,
            SecurityGroupIds = new[]
            {
                @group.Id,
            },
            PrivateIp = "192.168.0.2",
            PrivateIpsCount = 3,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.vpc.NetworkInterface;
    import com.pulumi.alicloud.vpc.NetworkInterfaceArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("networkInterfaceName");
            var vpc = new Network("vpc", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("192.168.0.0/24")
                .build());
    
            final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var vswitch = new Switch("vswitch", SwitchArgs.builder()
                .name(name)
                .cidrBlock("192.168.0.0/24")
                .zoneId(default_.zones()[0].id())
                .vpcId(vpc.id())
                .build());
    
            var group = new SecurityGroup("group", SecurityGroupArgs.builder()
                .name(name)
                .vpcId(vpc.id())
                .build());
    
            var defaultNetworkInterface = new NetworkInterface("defaultNetworkInterface", NetworkInterfaceArgs.builder()
                .networkInterfaceName(name)
                .vswitchId(vswitch.id())
                .securityGroupIds(group.id())
                .privateIp("192.168.0.2")
                .privateIpsCount(3)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: networkInterfaceName
    resources:
      vpc:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 192.168.0.0/24
      vswitch:
        type: alicloud:vpc:Switch
        properties:
          name: ${name}
          cidrBlock: 192.168.0.0/24
          zoneId: ${default.zones[0].id}
          vpcId: ${vpc.id}
      group:
        type: alicloud:ecs:SecurityGroup
        properties:
          name: ${name}
          vpcId: ${vpc.id}
      defaultNetworkInterface:
        type: alicloud:vpc:NetworkInterface
        name: default
        properties:
          networkInterfaceName: ${name}
          vswitchId: ${vswitch.id}
          securityGroupIds:
            - ${group.id}
          privateIp: 192.168.0.2
          privateIpsCount: 3
    variables:
      default:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    Create NetworkInterface Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NetworkInterface(name: string, args: NetworkInterfaceArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkInterface(resource_name: str,
                         args: NetworkInterfaceArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkInterface(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         vswitch_id: Optional[str] = None,
                         private_ip: Optional[str] = None,
                         security_groups: Optional[Sequence[str]] = None,
                         ipv4_prefixes: Optional[Sequence[str]] = None,
                         ipv6_address_count: Optional[int] = None,
                         ipv6_addresses: Optional[Sequence[str]] = None,
                         name: Optional[str] = None,
                         network_interface_name: Optional[str] = None,
                         private_ip_addresses: Optional[Sequence[str]] = None,
                         instance_type: Optional[str] = None,
                         ipv4_prefix_count: Optional[int] = None,
                         network_interface_traffic_mode: Optional[str] = None,
                         private_ips: Optional[Sequence[str]] = None,
                         private_ips_count: Optional[int] = None,
                         queue_number: Optional[int] = None,
                         resource_group_id: Optional[str] = None,
                         secondary_private_ip_address_count: Optional[int] = None,
                         security_group_ids: Optional[Sequence[str]] = None,
                         description: Optional[str] = None,
                         tags: Optional[Mapping[str, Any]] = None,
                         primary_ip_address: Optional[str] = None)
    func NewNetworkInterface(ctx *Context, name string, args NetworkInterfaceArgs, opts ...ResourceOption) (*NetworkInterface, error)
    public NetworkInterface(string name, NetworkInterfaceArgs args, CustomResourceOptions? opts = null)
    public NetworkInterface(String name, NetworkInterfaceArgs args)
    public NetworkInterface(String name, NetworkInterfaceArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:NetworkInterface
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkInterfaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var networkInterfaceResource = new AliCloud.Vpc.NetworkInterface("networkInterfaceResource", new()
    {
        VswitchId = "string",
        Ipv4Prefixes = new[]
        {
            "string",
        },
        Ipv6AddressCount = 0,
        Ipv6Addresses = new[]
        {
            "string",
        },
        NetworkInterfaceName = "string",
        PrivateIpAddresses = new[]
        {
            "string",
        },
        InstanceType = "string",
        Ipv4PrefixCount = 0,
        NetworkInterfaceTrafficMode = "string",
        QueueNumber = 0,
        ResourceGroupId = "string",
        SecondaryPrivateIpAddressCount = 0,
        SecurityGroupIds = new[]
        {
            "string",
        },
        Description = "string",
        Tags = 
        {
            { "string", "any" },
        },
        PrimaryIpAddress = "string",
    });
    
    example, err := vpc.NewNetworkInterface(ctx, "networkInterfaceResource", &vpc.NetworkInterfaceArgs{
    	VswitchId: pulumi.String("string"),
    	Ipv4Prefixes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Ipv6AddressCount: pulumi.Int(0),
    	Ipv6Addresses: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	NetworkInterfaceName: pulumi.String("string"),
    	PrivateIpAddresses: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	InstanceType:                   pulumi.String("string"),
    	Ipv4PrefixCount:                pulumi.Int(0),
    	NetworkInterfaceTrafficMode:    pulumi.String("string"),
    	QueueNumber:                    pulumi.Int(0),
    	ResourceGroupId:                pulumi.String("string"),
    	SecondaryPrivateIpAddressCount: pulumi.Int(0),
    	SecurityGroupIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	PrimaryIpAddress: pulumi.String("string"),
    })
    
    var networkInterfaceResource = new NetworkInterface("networkInterfaceResource", NetworkInterfaceArgs.builder()
        .vswitchId("string")
        .ipv4Prefixes("string")
        .ipv6AddressCount(0)
        .ipv6Addresses("string")
        .networkInterfaceName("string")
        .privateIpAddresses("string")
        .instanceType("string")
        .ipv4PrefixCount(0)
        .networkInterfaceTrafficMode("string")
        .queueNumber(0)
        .resourceGroupId("string")
        .secondaryPrivateIpAddressCount(0)
        .securityGroupIds("string")
        .description("string")
        .tags(Map.of("string", "any"))
        .primaryIpAddress("string")
        .build());
    
    network_interface_resource = alicloud.vpc.NetworkInterface("networkInterfaceResource",
        vswitch_id="string",
        ipv4_prefixes=["string"],
        ipv6_address_count=0,
        ipv6_addresses=["string"],
        network_interface_name="string",
        private_ip_addresses=["string"],
        instance_type="string",
        ipv4_prefix_count=0,
        network_interface_traffic_mode="string",
        queue_number=0,
        resource_group_id="string",
        secondary_private_ip_address_count=0,
        security_group_ids=["string"],
        description="string",
        tags={
            "string": "any",
        },
        primary_ip_address="string")
    
    const networkInterfaceResource = new alicloud.vpc.NetworkInterface("networkInterfaceResource", {
        vswitchId: "string",
        ipv4Prefixes: ["string"],
        ipv6AddressCount: 0,
        ipv6Addresses: ["string"],
        networkInterfaceName: "string",
        privateIpAddresses: ["string"],
        instanceType: "string",
        ipv4PrefixCount: 0,
        networkInterfaceTrafficMode: "string",
        queueNumber: 0,
        resourceGroupId: "string",
        secondaryPrivateIpAddressCount: 0,
        securityGroupIds: ["string"],
        description: "string",
        tags: {
            string: "any",
        },
        primaryIpAddress: "string",
    });
    
    type: alicloud:vpc:NetworkInterface
    properties:
        description: string
        instanceType: string
        ipv4PrefixCount: 0
        ipv4Prefixes:
            - string
        ipv6AddressCount: 0
        ipv6Addresses:
            - string
        networkInterfaceName: string
        networkInterfaceTrafficMode: string
        primaryIpAddress: string
        privateIpAddresses:
            - string
        queueNumber: 0
        resourceGroupId: string
        secondaryPrivateIpAddressCount: 0
        securityGroupIds:
            - string
        tags:
            string: any
        vswitchId: string
    

    NetworkInterface Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The NetworkInterface resource accepts the following input properties:

    VswitchId string
    The VSwitch to create the ENI in.
    Description string
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    InstanceType string
    Ipv4PrefixCount int
    Ipv4Prefixes List<string>
    Ipv6AddressCount int
    Ipv6Addresses List<string>
    Name string
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    NetworkInterfaceName string
    NetworkInterfaceTrafficMode string
    PrimaryIpAddress string
    PrivateIp string
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    PrivateIpAddresses List<string>
    PrivateIps List<string>
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    QueueNumber int
    ResourceGroupId string
    The Id of resource group which the network interface belongs.
    SecondaryPrivateIpAddressCount int
    SecurityGroupIds List<string>
    SecurityGroups List<string>
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    VswitchId string
    The VSwitch to create the ENI in.
    Description string
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    InstanceType string
    Ipv4PrefixCount int
    Ipv4Prefixes []string
    Ipv6AddressCount int
    Ipv6Addresses []string
    Name string
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    NetworkInterfaceName string
    NetworkInterfaceTrafficMode string
    PrimaryIpAddress string
    PrivateIp string
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    PrivateIpAddresses []string
    PrivateIps []string
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    QueueNumber int
    ResourceGroupId string
    The Id of resource group which the network interface belongs.
    SecondaryPrivateIpAddressCount int
    SecurityGroupIds []string
    SecurityGroups []string
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    vswitchId String
    The VSwitch to create the ENI in.
    description String
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instanceType String
    ipv4PrefixCount Integer
    ipv4Prefixes List<String>
    ipv6AddressCount Integer
    ipv6Addresses List<String>
    name String
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    networkInterfaceName String
    networkInterfaceTrafficMode String
    primaryIpAddress String
    privateIp String
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    privateIpAddresses List<String>
    privateIps List<String>
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    privateIpsCount Integer
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queueNumber Integer
    resourceGroupId String
    The Id of resource group which the network interface belongs.
    secondaryPrivateIpAddressCount Integer
    securityGroupIds List<String>
    securityGroups List<String>
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    vswitchId string
    The VSwitch to create the ENI in.
    description string
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instanceType string
    ipv4PrefixCount number
    ipv4Prefixes string[]
    ipv6AddressCount number
    ipv6Addresses string[]
    name string
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    networkInterfaceName string
    networkInterfaceTrafficMode string
    primaryIpAddress string
    privateIp string
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    privateIpAddresses string[]
    privateIps string[]
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    privateIpsCount number
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queueNumber number
    resourceGroupId string
    The Id of resource group which the network interface belongs.
    secondaryPrivateIpAddressCount number
    securityGroupIds string[]
    securityGroups string[]
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    vswitch_id str
    The VSwitch to create the ENI in.
    description str
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instance_type str
    ipv4_prefix_count int
    ipv4_prefixes Sequence[str]
    ipv6_address_count int
    ipv6_addresses Sequence[str]
    name str
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    network_interface_name str
    network_interface_traffic_mode str
    primary_ip_address str
    private_ip str
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    private_ip_addresses Sequence[str]
    private_ips Sequence[str]
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    private_ips_count int
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queue_number int
    resource_group_id str
    The Id of resource group which the network interface belongs.
    secondary_private_ip_address_count int
    security_group_ids Sequence[str]
    security_groups Sequence[str]
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    vswitchId String
    The VSwitch to create the ENI in.
    description String
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instanceType String
    ipv4PrefixCount Number
    ipv4Prefixes List<String>
    ipv6AddressCount Number
    ipv6Addresses List<String>
    name String
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    networkInterfaceName String
    networkInterfaceTrafficMode String
    primaryIpAddress String
    privateIp String
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    privateIpAddresses List<String>
    privateIps List<String>
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    privateIpsCount Number
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queueNumber Number
    resourceGroupId String
    The Id of resource group which the network interface belongs.
    secondaryPrivateIpAddressCount Number
    securityGroupIds List<String>
    securityGroups List<String>
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    tags Map<Any>
    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NetworkInterface resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Mac string
    (Available in 1.54.0+) The MAC address of an ENI.
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Mac string
    (Available in 1.54.0+) The MAC address of an ENI.
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    mac String
    (Available in 1.54.0+) The MAC address of an ENI.
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    mac string
    (Available in 1.54.0+) The MAC address of an ENI.
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    mac str
    (Available in 1.54.0+) The MAC address of an ENI.
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    mac String
    (Available in 1.54.0+) The MAC address of an ENI.
    status String

    Look up Existing NetworkInterface Resource

    Get an existing NetworkInterface resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NetworkInterfaceState, opts?: CustomResourceOptions): NetworkInterface
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            instance_type: Optional[str] = None,
            ipv4_prefix_count: Optional[int] = None,
            ipv4_prefixes: Optional[Sequence[str]] = None,
            ipv6_address_count: Optional[int] = None,
            ipv6_addresses: Optional[Sequence[str]] = None,
            mac: Optional[str] = None,
            name: Optional[str] = None,
            network_interface_name: Optional[str] = None,
            network_interface_traffic_mode: Optional[str] = None,
            primary_ip_address: Optional[str] = None,
            private_ip: Optional[str] = None,
            private_ip_addresses: Optional[Sequence[str]] = None,
            private_ips: Optional[Sequence[str]] = None,
            private_ips_count: Optional[int] = None,
            queue_number: Optional[int] = None,
            resource_group_id: Optional[str] = None,
            secondary_private_ip_address_count: Optional[int] = None,
            security_group_ids: Optional[Sequence[str]] = None,
            security_groups: Optional[Sequence[str]] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None,
            vswitch_id: Optional[str] = None) -> NetworkInterface
    func GetNetworkInterface(ctx *Context, name string, id IDInput, state *NetworkInterfaceState, opts ...ResourceOption) (*NetworkInterface, error)
    public static NetworkInterface Get(string name, Input<string> id, NetworkInterfaceState? state, CustomResourceOptions? opts = null)
    public static NetworkInterface get(String name, Output<String> id, NetworkInterfaceState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    InstanceType string
    Ipv4PrefixCount int
    Ipv4Prefixes List<string>
    Ipv6AddressCount int
    Ipv6Addresses List<string>
    Mac string
    (Available in 1.54.0+) The MAC address of an ENI.
    Name string
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    NetworkInterfaceName string
    NetworkInterfaceTrafficMode string
    PrimaryIpAddress string
    PrivateIp string
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    PrivateIpAddresses List<string>
    PrivateIps List<string>
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    QueueNumber int
    ResourceGroupId string
    The Id of resource group which the network interface belongs.
    SecondaryPrivateIpAddressCount int
    SecurityGroupIds List<string>
    SecurityGroups List<string>
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    Status string
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    VswitchId string
    The VSwitch to create the ENI in.
    Description string
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    InstanceType string
    Ipv4PrefixCount int
    Ipv4Prefixes []string
    Ipv6AddressCount int
    Ipv6Addresses []string
    Mac string
    (Available in 1.54.0+) The MAC address of an ENI.
    Name string
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    NetworkInterfaceName string
    NetworkInterfaceTrafficMode string
    PrimaryIpAddress string
    PrivateIp string
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    PrivateIpAddresses []string
    PrivateIps []string
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    PrivateIpsCount int
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    QueueNumber int
    ResourceGroupId string
    The Id of resource group which the network interface belongs.
    SecondaryPrivateIpAddressCount int
    SecurityGroupIds []string
    SecurityGroups []string
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    Status string
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    VswitchId string
    The VSwitch to create the ENI in.
    description String
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instanceType String
    ipv4PrefixCount Integer
    ipv4Prefixes List<String>
    ipv6AddressCount Integer
    ipv6Addresses List<String>
    mac String
    (Available in 1.54.0+) The MAC address of an ENI.
    name String
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    networkInterfaceName String
    networkInterfaceTrafficMode String
    primaryIpAddress String
    privateIp String
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    privateIpAddresses List<String>
    privateIps List<String>
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    privateIpsCount Integer
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queueNumber Integer
    resourceGroupId String
    The Id of resource group which the network interface belongs.
    secondaryPrivateIpAddressCount Integer
    securityGroupIds List<String>
    securityGroups List<String>
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    status String
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    vswitchId String
    The VSwitch to create the ENI in.
    description string
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instanceType string
    ipv4PrefixCount number
    ipv4Prefixes string[]
    ipv6AddressCount number
    ipv6Addresses string[]
    mac string
    (Available in 1.54.0+) The MAC address of an ENI.
    name string
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    networkInterfaceName string
    networkInterfaceTrafficMode string
    primaryIpAddress string
    privateIp string
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    privateIpAddresses string[]
    privateIps string[]
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    privateIpsCount number
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queueNumber number
    resourceGroupId string
    The Id of resource group which the network interface belongs.
    secondaryPrivateIpAddressCount number
    securityGroupIds string[]
    securityGroups string[]
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    status string
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    vswitchId string
    The VSwitch to create the ENI in.
    description str
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instance_type str
    ipv4_prefix_count int
    ipv4_prefixes Sequence[str]
    ipv6_address_count int
    ipv6_addresses Sequence[str]
    mac str
    (Available in 1.54.0+) The MAC address of an ENI.
    name str
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    network_interface_name str
    network_interface_traffic_mode str
    primary_ip_address str
    private_ip str
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    private_ip_addresses Sequence[str]
    private_ips Sequence[str]
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    private_ips_count int
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queue_number int
    resource_group_id str
    The Id of resource group which the network interface belongs.
    secondary_private_ip_address_count int
    security_group_ids Sequence[str]
    security_groups Sequence[str]
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    status str
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    vswitch_id str
    The VSwitch to create the ENI in.
    description String
    Description of the ENI. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    instanceType String
    ipv4PrefixCount Number
    ipv4Prefixes List<String>
    ipv6AddressCount Number
    ipv6Addresses List<String>
    mac String
    (Available in 1.54.0+) The MAC address of an ENI.
    name String
    Name of the ENI. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-", ".", "_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

    Deprecated: Field 'name' has been deprecated from provider version 1.123.1. New field 'network_interface_name' instead

    networkInterfaceName String
    networkInterfaceTrafficMode String
    primaryIpAddress String
    privateIp String
    The primary private IP of the ENI.

    Deprecated: Field 'private_ip' has been deprecated from provider version 1.123.1. New field 'primary_ip_address' instead

    privateIpAddresses List<String>
    privateIps List<String>
    List of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips' has been deprecated from provider version 1.123.1. New field 'private_ip_addresses' instead

    privateIpsCount Number
    Number of secondary private IPs to assign to the ENI. Don't use both private_ips and private_ips_count in the same ENI resource block.

    Deprecated: Field 'private_ips_count' has been deprecated from provider version 1.123.1. New field 'secondary_private_ip_address_count' instead

    queueNumber Number
    resourceGroupId String
    The Id of resource group which the network interface belongs.
    secondaryPrivateIpAddressCount Number
    securityGroupIds List<String>
    securityGroups List<String>
    A list of security group ids to associate with.

    Deprecated: Field 'security_groups' has been deprecated from provider version 1.123.1. New field 'security_group_ids' instead

    status String
    tags Map<Any>
    A mapping of tags to assign to the resource.
    vswitchId String
    The VSwitch to create the ENI in.

    Import

    ENI can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/networkInterface:NetworkInterface eni eni-abc1234567890000
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi