

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::EC2::NetworkInterfaceAttachment
<a name="aws-resource-ec2-networkinterfaceattachment"></a>

Attaches an elastic network interface (ENI) to an Amazon EC2 instance. You can use this resource type to attach additional network interfaces to an instance without interruption.

## Syntax
<a name="aws-resource-ec2-networkinterfaceattachment-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-ec2-networkinterfaceattachment-syntax.json"></a>

```
{
  "Type" : "AWS::EC2::NetworkInterfaceAttachment",
  "Properties" : {
      "[DeleteOnTermination](#cfn-ec2-networkinterfaceattachment-deleteontermination)" : Boolean,
      "[DeviceIndex](#cfn-ec2-networkinterfaceattachment-deviceindex)" : String,
      "[EnaQueueCount](#cfn-ec2-networkinterfaceattachment-enaqueuecount)" : Integer,
      "[EnaSrdSpecification](#cfn-ec2-networkinterfaceattachment-enasrdspecification)" : EnaSrdSpecification,
      "[InstanceId](#cfn-ec2-networkinterfaceattachment-instanceid)" : String,
      "[NetworkInterfaceId](#cfn-ec2-networkinterfaceattachment-networkinterfaceid)" : String
    }
}
```

### YAML
<a name="aws-resource-ec2-networkinterfaceattachment-syntax.yaml"></a>

```
Type: AWS::EC2::NetworkInterfaceAttachment
Properties:
  [DeleteOnTermination](#cfn-ec2-networkinterfaceattachment-deleteontermination): Boolean
  [DeviceIndex](#cfn-ec2-networkinterfaceattachment-deviceindex): String
  [EnaQueueCount](#cfn-ec2-networkinterfaceattachment-enaqueuecount): Integer
  [EnaSrdSpecification](#cfn-ec2-networkinterfaceattachment-enasrdspecification): 
    EnaSrdSpecification
  [InstanceId](#cfn-ec2-networkinterfaceattachment-instanceid): String
  [NetworkInterfaceId](#cfn-ec2-networkinterfaceattachment-networkinterfaceid): String
```

## Properties
<a name="aws-resource-ec2-networkinterfaceattachment-properties"></a>

`DeleteOnTermination`  <a name="cfn-ec2-networkinterfaceattachment-deleteontermination"></a>
Whether to delete the network interface when the instance terminates. By default, this value is set to `true`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DeviceIndex`  <a name="cfn-ec2-networkinterfaceattachment-deviceindex"></a>
The network interface's position in the attachment order. For example, the first attached network interface has a `DeviceIndex` of 0.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`EnaQueueCount`  <a name="cfn-ec2-networkinterfaceattachment-enaqueuecount"></a>
The number of ENA queues created with the instance.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EnaSrdSpecification`  <a name="cfn-ec2-networkinterfaceattachment-enasrdspecification"></a>
Configures ENA Express for the network interface that this action attaches to the instance.  
*Required*: No  
*Type*: [EnaSrdSpecification](aws-properties-ec2-networkinterfaceattachment-enasrdspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InstanceId`  <a name="cfn-ec2-networkinterfaceattachment-instanceid"></a>
The ID of the instance to which you will attach the ENI.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`NetworkInterfaceId`  <a name="cfn-ec2-networkinterfaceattachment-networkinterfaceid"></a>
The ID of the ENI that you want to attach.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-ec2-networkinterfaceattachment-return-values"></a>

### Ref
<a name="aws-resource-ec2-networkinterfaceattachment-return-values-ref"></a>

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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-ec2-networkinterfaceattachment-return-values-fn--getatt"></a>

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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-ec2-networkinterfaceattachment-return-values-fn--getatt-fn--getatt"></a>

`AttachmentId`  <a name="AttachmentId-fn::getatt"></a>
The ID of the network interface attachment.

## Examples
<a name="aws-resource-ec2-networkinterfaceattachment--examples"></a>



### Network interface attachment
<a name="aws-resource-ec2-networkinterfaceattachment--examples--Network_interface_attachment"></a>

The following example attaches `MyNetworkInterface` to `MyInstance`.

#### JSON
<a name="aws-resource-ec2-networkinterfaceattachment--examples--Network_interface_attachment--json"></a>

```
"NetworkInterfaceAttachment" : {
   "Type" : "AWS::EC2::NetworkInterfaceAttachment",
      "Properties" : {
         "InstanceId" : {"Ref" : "MyInstance"},
         "NetworkInterfaceId" : {"Ref" : "MyNetworkInterface"},
         "DeviceIndex" : "1" 
      }
}
```

#### YAML
<a name="aws-resource-ec2-networkinterfaceattachment--examples--Network_interface_attachment--yaml"></a>

```
NetworkInterfaceAttachment:
   Type: AWS::EC2::NetworkInterfaceAttachment
   Properties:
      InstanceId:
         Ref: MyInstance
      NetworkInterfaceId:
         Ref: MyNetworkInterface
      DeviceIndex: 1
```

# AWS::EC2::NetworkInterfaceAttachment EnaSrdSpecification
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdspecification"></a>

ENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances. With ENA Express, you can communicate between two EC2 instances in the same subnet within the same account, or in different accounts. Both sending and receiving instances must have ENA Express enabled.

To improve the reliability of network packet delivery, ENA Express reorders network packets on the receiving end by default. However, some UDP-based applications are designed to handle network packets that are out of order to reduce the overhead for packet delivery at the network layer. When ENA Express is enabled, you can specify whether UDP network traffic uses it.

## Syntax
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdspecification-syntax.json"></a>

```
{
  "[EnaSrdEnabled](#cfn-ec2-networkinterfaceattachment-enasrdspecification-enasrdenabled)" : Boolean,
  "[EnaSrdUdpSpecification](#cfn-ec2-networkinterfaceattachment-enasrdspecification-enasrdudpspecification)" : EnaSrdUdpSpecification
}
```

### YAML
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdspecification-syntax.yaml"></a>

```
  [EnaSrdEnabled](#cfn-ec2-networkinterfaceattachment-enasrdspecification-enasrdenabled): Boolean
  [EnaSrdUdpSpecification](#cfn-ec2-networkinterfaceattachment-enasrdspecification-enasrdudpspecification): 
    EnaSrdUdpSpecification
```

## Properties
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdspecification-properties"></a>

`EnaSrdEnabled`  <a name="cfn-ec2-networkinterfaceattachment-enasrdspecification-enasrdenabled"></a>
Indicates whether ENA Express is enabled for the network interface.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EnaSrdUdpSpecification`  <a name="cfn-ec2-networkinterfaceattachment-enasrdspecification-enasrdudpspecification"></a>
Configures ENA Express for UDP network traffic.  
*Required*: No  
*Type*: [EnaSrdUdpSpecification](aws-properties-ec2-networkinterfaceattachment-enasrdudpspecification.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::EC2::NetworkInterfaceAttachment EnaSrdUdpSpecification
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdudpspecification"></a>

ENA Express is compatible with both TCP and UDP transport protocols. When it's enabled, TCP traffic automatically uses it. However, some UDP-based applications are designed to handle network packets that are out of order, without a need for retransmission, such as live video broadcasting or other near-real-time applications. For UDP traffic, you can specify whether to use ENA Express, based on your application environment needs.

## Syntax
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdudpspecification-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdudpspecification-syntax.json"></a>

```
{
  "[EnaSrdUdpEnabled](#cfn-ec2-networkinterfaceattachment-enasrdudpspecification-enasrdudpenabled)" : Boolean
}
```

### YAML
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdudpspecification-syntax.yaml"></a>

```
  [EnaSrdUdpEnabled](#cfn-ec2-networkinterfaceattachment-enasrdudpspecification-enasrdudpenabled): Boolean
```

## Properties
<a name="aws-properties-ec2-networkinterfaceattachment-enasrdudpspecification-properties"></a>

`EnaSrdUdpEnabled`  <a name="cfn-ec2-networkinterfaceattachment-enasrdudpspecification-enasrdudpenabled"></a>
Indicates whether UDP traffic to and from the instance uses ENA Express. To specify this setting, you must first enable ENA Express.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)