NetworkInterfaceArgs

data class NetworkInterfaceArgs(val description: Output<String>? = null, val instanceType: Output<String>? = null, val ipv4PrefixCount: Output<Int>? = null, val ipv4Prefixes: Output<List<String>>? = null, val ipv6AddressCount: Output<Int>? = null, val ipv6Addresses: Output<List<String>>? = null, val name: Output<String>? = null, val networkInterfaceName: Output<String>? = null, val networkInterfaceTrafficMode: Output<String>? = null, val primaryIpAddress: Output<String>? = null, val privateIp: Output<String>? = null, val privateIpAddresses: Output<List<String>>? = null, val privateIps: Output<List<String>>? = null, val privateIpsCount: Output<Int>? = null, val queueNumber: Output<Int>? = null, val resourceGroupId: Output<String>? = null, val secondaryPrivateIpAddressCount: Output<Int>? = null, val securityGroupIds: Output<List<String>>? = null, val securityGroups: Output<List<String>>? = null, val tags: Output<Map<String, String>>? = null, val vswitchId: Output<String>? = null) : ConvertibleToJava<NetworkInterfaceArgs>

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&#46;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&#46;id],
private_ip="192.168.0.2",
private_ips_count=3)
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 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
})
}
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

Import

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

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

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, instanceType: Output<String>? = null, ipv4PrefixCount: Output<Int>? = null, ipv4Prefixes: Output<List<String>>? = null, ipv6AddressCount: Output<Int>? = null, ipv6Addresses: Output<List<String>>? = null, name: Output<String>? = null, networkInterfaceName: Output<String>? = null, networkInterfaceTrafficMode: Output<String>? = null, primaryIpAddress: Output<String>? = null, privateIp: Output<String>? = null, privateIpAddresses: Output<List<String>>? = null, privateIps: Output<List<String>>? = null, privateIpsCount: Output<Int>? = null, queueNumber: Output<Int>? = null, resourceGroupId: Output<String>? = null, secondaryPrivateIpAddressCount: Output<Int>? = null, securityGroupIds: Output<List<String>>? = null, securityGroups: Output<List<String>>? = null, tags: Output<Map<String, String>>? = null, vswitchId: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

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.

Link copied to clipboard
val instanceType: Output<String>? = null
Link copied to clipboard
val ipv4PrefixCount: Output<Int>? = null
Link copied to clipboard
val ipv4Prefixes: Output<List<String>>? = null
Link copied to clipboard
val ipv6AddressCount: Output<Int>? = null
Link copied to clipboard
val ipv6Addresses: Output<List<String>>? = null
Link copied to clipboard
val name: Output<String>? = null

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.

Link copied to clipboard
val networkInterfaceName: Output<String>? = null
Link copied to clipboard
val networkInterfaceTrafficMode: Output<String>? = null
Link copied to clipboard
val primaryIpAddress: Output<String>? = null
Link copied to clipboard
val privateIp: Output<String>? = null

The primary private IP of the ENI.

Link copied to clipboard
val privateIpAddresses: Output<List<String>>? = null
Link copied to clipboard
val privateIps: Output<List<String>>? = null

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.

Link copied to clipboard
val privateIpsCount: Output<Int>? = null

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.

Link copied to clipboard
val queueNumber: Output<Int>? = null
Link copied to clipboard
val resourceGroupId: Output<String>? = null

The Id of resource group which the network interface belongs.

Link copied to clipboard
val secondaryPrivateIpAddressCount: Output<Int>? = null
Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null
Link copied to clipboard
val securityGroups: Output<List<String>>? = null

A list of security group ids to associate with.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val vswitchId: Output<String>? = null

The VSwitch to create the ENI in.

Functions

Link copied to clipboard
open override fun toJava(): NetworkInterfaceArgs