NetworkInterface

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "networkInterfaceName";
        var vpc = new AliCloud.Vpc.Network("vpc", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "192.168.0.0/24",
        });
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableResourceCreation = "VSwitch",
        }));
        var vswitch = new AliCloud.Vpc.Switch("vswitch", new AliCloud.Vpc.SwitchArgs
        {
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
            CidrBlock = "192.168.0.0/24",
            VpcId = vpc.Id,
        });
        var @group = new AliCloud.Ecs.SecurityGroup("group", new AliCloud.Ecs.SecurityGroupArgs
        {
            VpcId = vpc.Id,
        });
        var defaultNetworkInterface = new AliCloud.Vpc.NetworkInterface("defaultNetworkInterface", new AliCloud.Vpc.NetworkInterfaceArgs
        {
            PrivateIp = "192.168.0.2",
            PrivateIpsCount = 3,
            SecurityGroups = 
            {
                @group.Id,
            },
            VswitchId = vswitch.Id,
        });
    }

}

Coming soon!

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", cidr_block="192.168.0.0/24")
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
vswitch = alicloud.vpc.Switch("vswitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="192.168.0.0/24",
    vpc_id=vpc.id)
group = alicloud.ecs.SecurityGroup("group", vpc_id=vpc.id)
default_network_interface = alicloud.vpc.NetworkInterface("defaultNetworkInterface",
    private_ip="192.168.0.2",
    private_ips_count=3,
    security_groups=[group.id],
    vswitch_id=vswitch.id)
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", {
    cidrBlock: "192.168.0.0/24",
});
const defaultZones = pulumi.output(alicloud.getZones({
    availableResourceCreation: "VSwitch",
}, { async: true }));
const vswitch = new alicloud.vpc.Switch("vswitch", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "192.168.0.0/24",
    vpcId: vpc.id,
});
const group = new alicloud.ecs.SecurityGroup("group", {
    vpcId: vpc.id,
});
const defaultNetworkInterface = new alicloud.vpc.NetworkInterface("default", {
    privateIp: "192.168.0.2",
    privateIpsCount: 3,
    securityGroups: [group.id],
    vswitchId: vswitch.id,
});

Create a NetworkInterface Resource

def NetworkInterface(resource_name, opts=None, description=None, name=None, private_ip=None, private_ips=None, private_ips_count=None, resource_group_id=None, security_groups=None, tags=None, vswitch_id=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

NetworkInterface Resource Properties

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

Inputs

The NetworkInterface resource accepts the following input properties:

SecurityGroups List<string>

A list of security group ids to associate with.

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.

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.

PrivateIp string

The primary private IP of the ENI.

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.

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.

ResourceGroupId string

The Id of resource group which the network interface belongs.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

SecurityGroups []string

A list of security group ids to associate with.

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.

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.

PrivateIp string

The primary private IP of the ENI.

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.

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.

ResourceGroupId string

The Id of resource group which the network interface belongs.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

securityGroups string[]

A list of security group ids to associate with.

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.

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.

privateIp string

The primary private IP of the ENI.

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.

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.

resourceGroupId string

The Id of resource group which the network interface belongs.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

security_groups List[str]

A list of security group ids to associate with.

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.

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.

private_ip str

The primary private IP of the ENI.

private_ips List[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.

private_ips_count float

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.

resource_group_id str

The Id of resource group which the network interface belongs.

tags Dict[str, 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.

Id string
The provider-assigned unique ID for this managed resource.
Mac string

(Available in 1.54.0+) The MAC address of an ENI.

id string
The provider-assigned unique ID for this managed resource.
mac string

(Available in 1.54.0+) The MAC address of an ENI.

id str
The provider-assigned unique ID for this managed resource.
mac str

(Available in 1.54.0+) The MAC address of an ENI.

Look up an 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
static get(resource_name, id, opts=None, description=None, mac=None, name=None, private_ip=None, private_ips=None, private_ips_count=None, resource_group_id=None, security_groups=None, tags=None, vswitch_id=None, __props__=None);
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)
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.

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.

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.

PrivateIp string

The primary private IP of the ENI.

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.

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.

ResourceGroupId string

The Id of resource group which the network interface belongs.

SecurityGroups List<string>

A list of security group ids to associate with.

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.

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.

PrivateIp string

The primary private IP of the ENI.

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.

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.

ResourceGroupId string

The Id of resource group which the network interface belongs.

SecurityGroups []string

A list of security group ids to associate with.

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.

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.

privateIp string

The primary private IP of the ENI.

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.

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.

resourceGroupId string

The Id of resource group which the network interface belongs.

securityGroups string[]

A list of security group ids to associate with.

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.

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.

private_ip str

The primary private IP of the ENI.

private_ips List[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.

private_ips_count float

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.

resource_group_id str

The Id of resource group which the network interface belongs.

security_groups List[str]

A list of security group ids to associate with.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

vswitch_id str

The VSwitch to create the ENI in.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.