Interface CfnInstance.INetworkInterfaceProperty
Specifies a network interface that is to be attached to an instance.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface INetworkInterfaceProperty
Syntax (vb)
Public Interface INetworkInterfaceProperty
Remarks
You can create a network interface when launching an instance. For an example, see the AWS::EC2::Instance examples .
Alternatively, you can attach an existing network interface when launching an instance. For an example, see the AWS::EC2:NetworkInterface examples .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var networkInterfaceProperty = new NetworkInterfaceProperty {
DeviceIndex = "deviceIndex",
// the properties below are optional
AssociateCarrierIpAddress = false,
AssociatePublicIpAddress = false,
DeleteOnTermination = false,
Description = "description",
GroupSet = new [] { "groupSet" },
Ipv6AddressCount = 123,
Ipv6Addresses = new [] { new InstanceIpv6AddressProperty {
Ipv6Address = "ipv6Address"
} },
NetworkInterfaceId = "networkInterfaceId",
PrivateIpAddress = "privateIpAddress",
PrivateIpAddresses = new [] { new PrivateIpAddressSpecificationProperty {
Primary = false,
PrivateIpAddress = "privateIpAddress"
} },
SecondaryPrivateIpAddressCount = 123,
SubnetId = "subnetId"
};
Synopsis
Properties
AssociateCarrierIpAddress | Indicates whether to assign a carrier IP address to the network interface. |
AssociatePublicIpAddress | Indicates whether to assign a public IPv4 address to an instance. |
DeleteOnTermination | Indicates whether the network interface is deleted when the instance is terminated. |
Description | The description of the network interface. |
DeviceIndex | The position of the network interface in the attachment order. |
GroupSet | The IDs of the security groups for the network interface. |
Ipv6AddressCount | A number of IPv6 addresses to assign to the network interface. |
Ipv6Addresses | The IPv6 addresses to assign to the network interface. |
NetworkInterfaceId | The ID of the network interface, when attaching an existing network interface. |
PrivateIpAddress | The private IPv4 address of the network interface. |
PrivateIpAddresses | One or more private IPv4 addresses to assign to the network interface. |
SecondaryPrivateIpAddressCount | The number of secondary private IPv4 addresses. |
SubnetId | The ID of the subnet associated with the network interface. |
Properties
AssociateCarrierIpAddress
Indicates whether to assign a carrier IP address to the network interface.
virtual object AssociateCarrierIpAddress { get; }
Property Value
System.Object
Remarks
You can only assign a carrier IP address to a network interface that is in a subnet in a Wavelength Zone. For more information about carrier IP addresses, see Carrier IP address in the AWS Wavelength Developer Guide .
AssociatePublicIpAddress
Indicates whether to assign a public IPv4 address to an instance.
virtual object AssociatePublicIpAddress { get; }
Property Value
System.Object
Remarks
Applies only if creating a network interface when launching an instance. The network interface must be the primary network interface. If launching into a default subnet, the default value is true
.
AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page .
DeleteOnTermination
Indicates whether the network interface is deleted when the instance is terminated.
virtual object DeleteOnTermination { get; }
Property Value
System.Object
Remarks
Applies only if creating a network interface when launching an instance.
Description
The description of the network interface.
virtual string Description { get; }
Property Value
System.String
Remarks
Applies only if creating a network interface when launching an instance.
DeviceIndex
The position of the network interface in the attachment order.
string DeviceIndex { get; }
Property Value
System.String
Remarks
A primary network interface has a device index of 0.
If you create a network interface when launching an instance, you must specify the device index.
GroupSet
The IDs of the security groups for the network interface.
virtual string[] GroupSet { get; }
Property Value
System.String[]
Remarks
Applies only if creating a network interface when launching an instance.
Ipv6AddressCount
A number of IPv6 addresses to assign to the network interface.
virtual Nullable<double> Ipv6AddressCount { get; }
Property Value
System.Nullable<System.Double>
Remarks
Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
Ipv6Addresses
The IPv6 addresses to assign to the network interface.
virtual object Ipv6Addresses { get; }
Property Value
System.Object
Remarks
You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
NetworkInterfaceId
The ID of the network interface, when attaching an existing network interface.
virtual string NetworkInterfaceId { get; }
Property Value
System.String
Remarks
PrivateIpAddress
The private IPv4 address of the network interface.
virtual string PrivateIpAddress { get; }
Property Value
System.String
Remarks
Applies only if creating a network interface when launching an instance.
PrivateIpAddresses
One or more private IPv4 addresses to assign to the network interface.
virtual object PrivateIpAddresses { get; }
Property Value
System.Object
Remarks
Only one private IPv4 address can be designated as primary.
SecondaryPrivateIpAddressCount
The number of secondary private IPv4 addresses.
virtual Nullable<double> SecondaryPrivateIpAddressCount { get; }
Property Value
System.Nullable<System.Double>
Remarks
You can't specify this option and specify more than one private IP address using the private IP addresses option.
SubnetId
The ID of the subnet associated with the network interface.
virtual string SubnetId { get; }
Property Value
System.String