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 | Resource Type definition for AWS::EC2::NetworkInterfaceAttachment |
Id | aws.ec2.network_interface_attachments |
Fields
Name | Datatype | Description |
---|---|---|
attachment_id | string | The ID of the network interface attachment. |
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 | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DeviceIndex, InstanceId, NetworkInterfaceId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all network_interface_attachments
in a region.
SELECT
region,
attachment_id,
delete_on_termination,
device_index,
instance_id,
network_interface_id,
ena_srd_specification
FROM aws.ec2.network_interface_attachments
WHERE region = 'us-east-1';
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 aws.ec2.network_interface_attachments
WHERE region = 'us-east-1' AND data__Identifier = '<AttachmentId>';
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 aws.ec2.network_interface_attachments (
DeviceIndex,
InstanceId,
NetworkInterfaceId,
region
)
SELECT
'{{ DeviceIndex }}',
'{{ InstanceId }}',
'{{ NetworkInterfaceId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.network_interface_attachments (
DeleteOnTermination,
DeviceIndex,
InstanceId,
NetworkInterfaceId,
EnaSrdSpecification,
region
)
SELECT
'{{ DeleteOnTermination }}',
'{{ DeviceIndex }}',
'{{ InstanceId }}',
'{{ NetworkInterfaceId }}',
'{{ EnaSrdSpecification }}',
'{{ 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: DeleteOnTermination
value: '{{ DeleteOnTermination }}'
- name: DeviceIndex
value: '{{ DeviceIndex }}'
- name: InstanceId
value: '{{ InstanceId }}'
- name: NetworkInterfaceId
value: '{{ NetworkInterfaceId }}'
- name: EnaSrdSpecification
value:
EnaSrdEnabled: '{{ EnaSrdEnabled }}'
EnaSrdUdpSpecification:
EnaSrdUdpEnabled: '{{ EnaSrdUdpEnabled }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.network_interface_attachments
WHERE data__Identifier = '<AttachmentId>'
AND region = 'us-east-1';
Permissions
To operate on the network_interface_attachments
resource, the following permissions are required:
Create
ec2:AttachNetworkInterface,
ec2:DescribeNetworkInterfaces,
ec2:ModifyNetworkInterfaceAttribute
Read
ec2:DescribeNetworkInterfaces
List
ec2:DescribeNetworkInterfaces
Update
ec2:ModifyNetworkInterfaceAttribute,
ec2:DescribeNetworkInterfaces,
ec2:AttachNetworkInterface,
ec2:DetachNetworkInterface
Delete
ec2:DetachNetworkInterface,
ec2:DescribeNetworkInterfaces