Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Describes a network interface in an Elastic Compute Cloud (EC2) instance for AWS CloudFormation.
To declare this entity in your AWS CloudFormation template, use the following syntax:
{ "Type" : "AWS::EC2::NetworkInterface", "Properties" : { "Description" :String, "GroupSet" :[ String, ... ], "InterfaceType" :String, "Ipv6AddressCount" :Integer, "Ipv6Addresses" :InstanceIpv6Address, "PrivateIpAddress" :String, "PrivateIpAddresses" :[ PrivateIpAddressSpecification, ... ], "SecondaryPrivateIpAddressCount" :Integer, "SourceDestCheck" :Boolean, "SubnetId" :String, "Tags" :[ Tag, ... ]} }
Type: AWS::EC2::NetworkInterface Properties: Description:StringGroupSet:- StringInterfaceType:StringIpv6AddressCount:IntegerIpv6Addresses:InstanceIpv6AddressPrivateIpAddress:StringPrivateIpAddresses:- PrivateIpAddressSpecificationSecondaryPrivateIpAddressCount:IntegerSourceDestCheck:BooleanSubnetId:StringTags:- Tag
DescriptionA description for the network interface.
Required: No
Type: String
Update requires: No interruption
GroupSetA list of security group IDs associated with this network interface.
Required: No
Type: List of String
Update requires: No interruption
InterfaceTypeIndicates the type of network interface. To create an Elastic Fabric Adapter (EFA),
specify
efa. For more information, see
Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide.
Required: No
Type: String
Allowed Values: efa
Update requires: Replacement
Ipv6AddressCountThe number of IPv6 addresses to assign to a network interface. Amazon EC2
automatically selects the IPv6 addresses from the subnet range. To specify specific
IPv6 addresses, use the
Ipv6Addresses property and don't specify this property.
Required: No
Type: Integer
Update requires: No interruption
Ipv6AddressesOne or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet
to associate with the network interface.
If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.
Required: No
Type: InstanceIpv6Address
Update requires: No interruption
PrivateIpAddressAssigns a single private IP address to the network interface, which is
used as the primary private IP address. If you want to specify multiple private
IP address, use the PrivateIpAddresses property.
Required: No
Type: String
Update requires: Replacement
PrivateIpAddressesAssigns a list of private IP addresses to the network interface. You can specify a
primary private IP address by setting the value of the
Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the
SecondaryPrivateIpAddressCount property and do not specify this property.
Required: No
Type: List of PrivateIpAddressSpecification
Update requires: Some interruptions
SecondaryPrivateIpAddressCountThe number of secondary private IPv4 addresses to assign to a network interface. When
you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses
within the subnet's IPv4 CIDR range. You can't specify this option and specify more
than
one private IP address using privateIpAddresses.
The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide.
Required: No
Type: Integer
Update requires: No interruption
SourceDestCheckIndicates whether traffic to or from the instance is validated.
Required: No
Type: Boolean
Update requires: No interruption
SubnetIdThe ID of the subnet to associate with the network interface.
Required: Yes
Type: String
Update requires: Replacement
TagsAn arbitrary set of tags (key–value pairs) for this network interface.
Required: No
Type: List of Tag
Update requires: No interruption
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource name.
For more information about using the Ref function, see Ref.
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following
are the available attributes and sample return values.
For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.
Tip
For more NetworkInterface template examples,
see Elastic Network Interface (ENI) Template
Snippets.
This is a simple standalone Elastic Network Interface (ENI), using all of the available properties.
"myENI" : { "Type" : "AWS::EC2::NetworkInterface", "Properties" : { "Tags": [{"Key":"foo","Value":"bar"}], "Description": "A nice description.", "SourceDestCheck": "false", "GroupSet": ["sg-75zzz219"], "SubnetId": "subnet-3z648z53", "PrivateIpAddress": "10.0.0.16" } }
myENI: Type: AWS::EC2::NetworkInterface Properties: Tags: - Key: foo Value: bar Description: A nice description. SourceDestCheck: 'false' GroupSet: - sg-75zzz219 SubnetId: subnet-3z648z53 PrivateIpAddress: 10.0.0.16
This is an example of an ENI on an EC2 instance. In this example, one ENI is added
to the instance.
If you want to add more than one ENI, you can specify a list for the NetworkInterface
property.
However, you can specify multiple ENIs only if all the ENIs have just private IP addresses
(no associated public IP address). If you have an ENI with a public IP address, specify
it
and then use the AWS::EC2::NetworkInterfaceAttachment resource to add additional ENIs.
"Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, "KeyName" : { "Ref" : "KeyName" }, "SecurityGroupIds" : [{ "Ref" : "WebSecurityGroup" }], "SubnetId" : { "Ref" : "SubnetId" }, "NetworkInterfaces" : [ { "NetworkInterfaceId" : {"Ref" : "controlXface"}, "DeviceIndex" : "1" } ], "Tags" : [ {"Key" : "Role", "Value" : "Test Instance"}], "UserData" : { "Fn::Base64" : { "Ref" : "WebServerPort" }} } }
Ec2Instance: Type: AWS::EC2::Instance Properties: ImageId: Fn::FindInMap: - RegionMap - Ref: AWS::Region - AMI KeyName: Ref: KeyName SecurityGroupIds: - Ref: WebSecurityGroup SubnetId: Ref: SubnetId NetworkInterfaces: - NetworkInterfaceId: Ref: controlXface DeviceIndex: '0' Tags: - Key: Role Value: Test Instance UserData: Fn::Base64: Ref: WebServerPort
NetworkInterface in the Amazon Elastic Compute Cloud API Reference