network_interface_attachments
Creates, updates, deletes or gets a network_interface_attachment resource or lists network_interface_attachments in a region
Overview
| Name | network_interface_attachments |
| Type | Resource |
| Description | 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. |
| Id | awscc.ec2.network_interface_attachments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
attachment_id | string | |
delete_on_termination | boolean | Whether to delete the network interface when the instance terminates. By default, this value is set to ``true``. |
device_index | string | The network interface's position in the attachment order. For example, the first attached network interface has a ``DeviceIndex`` of 0. |
instance_id | string | The ID of the instance to which you will attach the ENI. |
network_interface_id | string | The ID of the ENI that you want to attach. |
ena_srd_specification | object | Configures ENA Express for the network interface that this action attaches to the instance. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
attachment_id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::NetworkInterfaceAttachment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | network_interface_attachments | INSERT | DeviceIndex, InstanceId, NetworkInterfaceId, region |
delete_resource | network_interface_attachments | DELETE | Identifier, region |
update_resource | network_interface_attachments | UPDATE | Identifier, PatchDocument, region |
list_resources | network_interface_attachments_list_only | SELECT | region |
get_resource | network_interface_attachments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all network_interface_attachments in a region.
SELECT
region,
attachment_id
FROM awscc.ec2.network_interface_attachments_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new network_interface_attachment resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.network_interface_attachments (
DeviceIndex,
InstanceId,
NetworkInterfaceId,
region
)
SELECT
'{{ device_index }}',
'{{ instance_id }}',
'{{ network_interface_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ec2.network_interface_attachments (
DeleteOnTermination,
DeviceIndex,
InstanceId,
NetworkInterfaceId,
EnaSrdSpecification,
region
)
SELECT
'{{ delete_on_termination }}',
'{{ device_index }}',
'{{ instance_id }}',
'{{ network_interface_id }}',
'{{ ena_srd_specification }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: network_interface_attachment
props:
- name: delete_on_termination
value: '{{ delete_on_termination }}'
- name: device_index
value: '{{ device_index }}'
- name: instance_id
value: '{{ instance_id }}'
- name: network_interface_id
value: '{{ network_interface_id }}'
- name: ena_srd_specification
value:
ena_srd_enabled: '{{ ena_srd_enabled }}'
ena_srd_udp_specification:
ena_srd_udp_enabled: '{{ ena_srd_udp_enabled }}'
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:
- Create
- Read
- List
- Update
- Delete
ec2:AttachNetworkInterface,
ec2:DescribeNetworkInterfaces,
ec2:ModifyNetworkInterfaceAttribute
ec2:DescribeNetworkInterfaces
ec2:DescribeNetworkInterfaces
ec2:ModifyNetworkInterfaceAttribute,
ec2:DescribeNetworkInterfaces,
ec2:AttachNetworkInterface,
ec2:DetachNetworkInterface
ec2:DetachNetworkInterface,
ec2:DescribeNetworkInterfaces