Optional ReadonlydeleteWhether the interface is deleted when the instance terminates. Defaults to false, overriding CloudFormation's own default of true, so that the interface and its private IP survive termination and can be attached to a replacement instance.
Use cases: Preserving an allowlisted private IP across instance replacement
AWS: EC2 NetworkInterfaceAttachment DeleteOnTermination
Validation: Optional; boolean
ReadonlydeviceDevice index at which the interface is attached.
Use cases: Ordering multiple secondary interfaces on one instance
AWS: EC2 NetworkInterfaceAttachment DeviceIndex
Validation: Required; integer >= 1, unique per instance. Index 0 is the instance's primary interface and is rejected, because a primary interface cannot be detached and would make the instance un-updatable
Changing the index of an already-deployed networkInterface attachment replaces the attachment, which CloudFormation performs delete-then-create for this resource type, so the interface detaches and re-attaches at the new index in a single deploy. Two edits still need two deploys -- remove the entry, deploy, then add it back: changing the index of a networkInterfaceId attachment, and moving an interface onto an index that another interface still holds.
Optional ReadonlynetworkName of a network interface from the networkInterfaces section of this config. Mutually exclusive with networkInterfaceId.
Use cases: Attach an interface declared and managed by this config
AWS: EC2 NetworkInterfaceAttachment NetworkInterfaceId
Validation: Optional; must match a key in the networkInterfaces config section; exactly one of networkInterface or networkInterfaceId is required
Optional ReadonlynetworkID of a network interface created outside this config. Mutually exclusive with networkInterface.
Use cases: Attach an interface created by another module or by hand
AWS: EC2 NetworkInterfaceAttachment NetworkInterfaceId
Validation: Optional; valid network interface ID (eni-...; supports ssm: references); exactly one of networkInterface or networkInterfaceId is required
Attachment of an existing or config-declared network interface to an instance as a secondary interface. Rendered as a standalone NetworkInterfaceAttachment resource, which is what allows an instance-replacing update to detach the interface from the old instance before attaching it to the new one. The instance's primary interface cannot be customized.