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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.network_interface_attachments
WHERE
Identifier = '{{ attachment_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

ec2:AttachNetworkInterface,
ec2:DescribeNetworkInterfaces,
ec2:ModifyNetworkInterfaceAttribute