# CfnNetworkInterfaceAttachmentProps

Properties for defining a `CfnNetworkInterfaceAttachment`.

Used as props by: [CfnNetworkInterfaceAttachment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnNetworkInterfaceAttachment.html)

- Source: Generated at build time
- Type last changed: v2.217.0 · 25 Sep 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnNetworkInterfaceAttachmentProps: ec2.CfnNetworkInterfaceAttachmentProps = {
  deviceIndex: 'deviceIndex',
  instanceId: 'instanceId',
  networkInterfaceId: 'networkInterfaceId',

  // the properties below are optional
  deleteOnTermination: false,
  enaQueueCount: 123,
  enaSrdSpecification: {
    enaSrdEnabled: false,
    enaSrdUdpSpecification: {
      enaSrdUdpEnabled: false,
    },
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

cfn_network_interface_attachment_props = ec2.CfnNetworkInterfaceAttachmentProps(
    device_index="deviceIndex",
    instance_id="instanceId",
    network_interface_id="networkInterfaceId",

    # the properties below are optional
    delete_on_termination=False,
    ena_queue_count=123,
    ena_srd_specification=ec2.CfnNetworkInterfaceAttachment.EnaSrdSpecificationProperty(
        ena_srd_enabled=False,
        ena_srd_udp_specification=ec2.CfnNetworkInterfaceAttachment.EnaSrdUdpSpecificationProperty(
            ena_srd_udp_enabled=False
        )
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

CfnNetworkInterfaceAttachmentProps cfnNetworkInterfaceAttachmentProps = CfnNetworkInterfaceAttachmentProps.builder()
        .deviceIndex("deviceIndex")
        .instanceId("instanceId")
        .networkInterfaceId("networkInterfaceId")

        // the properties below are optional
        .deleteOnTermination(false)
        .enaQueueCount(123)
        .enaSrdSpecification(EnaSrdSpecificationProperty.builder()
                .enaSrdEnabled(false)
                .enaSrdUdpSpecification(EnaSrdUdpSpecificationProperty.builder()
                        .enaSrdUdpEnabled(false)
                        .build())
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// 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 cfnNetworkInterfaceAttachmentProps = new CfnNetworkInterfaceAttachmentProps {
    DeviceIndex = "deviceIndex",
    InstanceId = "instanceId",
    NetworkInterfaceId = "networkInterfaceId",

    // the properties below are optional
    DeleteOnTermination = false,
    EnaQueueCount = 123,
    EnaSrdSpecification = new EnaSrdSpecificationProperty {
        EnaSrdEnabled = false,
        EnaSrdUdpSpecification = new EnaSrdUdpSpecificationProperty {
            EnaSrdUdpEnabled = false
        }
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnNetworkInterfaceAttachmentProps := &CfnNetworkInterfaceAttachmentProps{
	DeviceIndex: jsii.String("deviceIndex"),
	InstanceId: jsii.String("instanceId"),
	NetworkInterfaceId: jsii.String("networkInterfaceId"),

	// the properties below are optional
	DeleteOnTermination: jsii.Boolean(false),
	EnaQueueCount: jsii.Number(123),
	EnaSrdSpecification: &EnaSrdSpecificationProperty{
		EnaSrdEnabled: jsii.Boolean(false),
		EnaSrdUdpSpecification: &EnaSrdUdpSpecificationProperty{
			EnaSrdUdpEnabled: jsii.Boolean(false),
		},
	},
}
```

## Properties

- `deleteOnTermination`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = true — Whether to delete the network interface when the instance terminates.

  By default, this value is set to `true` .

- `deviceIndex`: string (required) — The network interface's position in the attachment order.

  For example, the first attached network interface has a `DeviceIndex` of 0.

- `enaQueueCount`: number — The number of ENA queues created with the instance.

- `enaSrdSpecification`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnNetworkInterfaceAttachment.EnaSrdSpecificationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnNetworkInterfaceAttachment.EnaSrdSpecificationProperty.html) — Configures ENA Express for the network interface that this action attaches to the instance.

- `instanceId`: string (required) — The ID of the instance to which you will attach the ENI.

- `networkInterfaceId`: string (required) — The ID of the ENI that you want to attach.
