Skip to main content

network_interface_attachments

Creates, updates, deletes or gets a network_interface_attachment resource or lists network_interface_attachments in a region

Overview

Namenetwork_interface_attachments
TypeResource
DescriptionAttaches 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.
Idawscc.ec2.network_interface_attachments

Fields

NameDatatypeDescription
attachment_idstring
delete_on_terminationbooleanWhether to delete the network interface when the instance terminates. By default, this value is set to ``true``.
device_indexstringThe network interface's position in the attachment order. For example, the first attached network interface has a ``DeviceIndex`` of 0.
instance_idstringThe ID of the instance to which you will attach the ENI.
network_interface_idstringThe ID of the ENI that you want to attach.
ena_srd_specificationobjectConfigures ENA Express for the network interface that this action attaches to the instance.
regionstringAWS region.

For more information, see AWS::EC2::NetworkInterfaceAttachment.

Methods

NameResourceAccessible byRequired Params
create_resourcenetwork_interface_attachmentsINSERTDeviceIndex, InstanceId, NetworkInterfaceId, region
delete_resourcenetwork_interface_attachmentsDELETEIdentifier, region
update_resourcenetwork_interface_attachmentsUPDATEIdentifier, PatchDocument, region
list_resourcesnetwork_interface_attachments_list_onlySELECTregion
get_resourcenetwork_interface_attachmentsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual network_interface_attachment.

SELECT
region,
attachment_id,
delete_on_termination,
device_index,
instance_id,
network_interface_id,
ena_srd_specification
FROM awscc.ec2.network_interface_attachments
WHERE
region = 'us-east-1' AND
Identifier = '{{ attachment_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new network_interface_attachment resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.network_interface_attachments (
DeviceIndex,
InstanceId,
NetworkInterfaceId,
region
)
SELECT
'{{ device_index }}',
'{{ instance_id }}',
'{{ network_interface_id }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a network_interface_attachment resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.network_interface_attachments
SET PatchDocument = string('{{ {
"DeleteOnTermination": delete_on_termination,
"EnaSrdSpecification": ena_srd_specification
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ attachment_id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.network_interface_attachments
WHERE
Identifier = '{{ attachment_id }}' AND
region = 'us-east-1';

Permissions

To operate on the network_interface_attachments resource, the following permissions are required:

ec2:AttachNetworkInterface,
ec2:DescribeNetworkInterfaces,
ec2:ModifyNetworkInterfaceAttribute