AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AWS::EC2::NetworkInterface

Describes a network interface in an Elastic Compute Cloud (EC2) instance for AWS CloudFormation. This is provided in a list in the NetworkInterfaces property of AWS::EC2::Instance.

Syntax

{
   "Type" : "AWS::EC2::NetworkInterface",
   "Properties" : {
      "Description": String,
      "GroupSet": [ String ],
      "PrivateIpAddress": String,
      "SourceDestCheck": Boolean,
      "SubnetId": String,
      "Tags": [ EC2 Tags, ...],
   }
}
      

Properties

Description

The description of this network interface.

Required: No.

Type: String.

Update requires: no interruption

GroupSet

A list of security group IDs associated with this network interface.

Required: No.

Type: String..

Update requires: no interruption

PrivateIpAddress

IP address of the interface within the subnet.

Required: No.

Type: String.

Update requires: replacement

SourceDestCheck

Flag indicating whether traffic to or from the instance is validated.

Required: No.

Type: Boolean.

Update requires: no interruption

SubnetId

The ID of the subnet to associate with the network interface.

Required: Yes.

Type: String.

Update requires: replacement

Tags

A list of tags associated with this network interface.

Required: No.

Type: List of EC2 Tag.

Update requires: no interruption

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, it returns the resource name.

For more information about using the Ref function, see Ref.

Template Examples

Tip

For more NetworkInterface template examples, see Elastic Network Interface (ENI) Template Snippets.

Simple Standalone ENI

This is a simple stand-alone Elastic Network Interface (ENI), using all of the available properties.

{
   "AWSTemplateFormatVersion" : "2010-09-09",
   "Description" : "Simple Standalone ENI",
   "Resources" : {
      "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"
         }
      }
   }
}        

ENI on an EC2 instance

This is an example of an ENI on an EC2 instance. In this example, one ENI is added to the instance, but since NetworkInterfaces is a list, you can add more than one.

"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" }}
   }
}        

See Also