Show / Hide Table of Contents

Class 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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
NetworkInterface
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Vpc
Assembly: Pulumi.AliCloud.dll
Syntax
public class NetworkInterface : CustomResource

Constructors

View Source

NetworkInterface(String, NetworkInterfaceArgs, CustomResourceOptions)

Create a NetworkInterface resource with the given unique name, arguments, and options.

Declaration
public NetworkInterface(string name, NetworkInterfaceArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

NetworkInterfaceArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Description

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.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

Mac

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

Declaration
public Output<string> Mac { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

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.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

PrivateIp

The primary private IP of the ENI.

Declaration
public Output<string> PrivateIp { get; }
Property Value
Type Description
Output<System.String>
View Source

PrivateIps

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.

Declaration
public Output<ImmutableArray<string>> PrivateIps { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

PrivateIpsCount

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.

Declaration
public Output<int> PrivateIpsCount { get; }
Property Value
Type Description
Output<System.Int32>
View Source

ResourceGroupId

The Id of resource group which the network interface belongs.

Declaration
public Output<string> ResourceGroupId { get; }
Property Value
Type Description
Output<System.String>
View Source

SecurityGroups

A list of security group ids to associate with.

Declaration
public Output<ImmutableArray<string>> SecurityGroups { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Tags

A mapping of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VswitchId

The VSwitch to create the ENI in.

Declaration
public Output<string> VswitchId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, NetworkInterfaceState, CustomResourceOptions)

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

Declaration
public static NetworkInterface Get(string name, Input<string> id, NetworkInterfaceState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

NetworkInterfaceState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
NetworkInterface
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.