Skip to main content

network_interface_permissions

Creates, updates, deletes, gets or lists a network_interface_permissions resource.

Overview

Namenetwork_interface_permissions
TypeResource
Idaws.ec2.network_interface_permissions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
aws_account_idstringThe Amazon Web Services account ID.
aws_servicestringThe Amazon Web Services service.
network_interface_idstringThe ID of the network interface.
network_interface_permission_idstringThe ID of the network interface permission.
permissionstringThe type of permission.
permission_statestringInformation about the state of the permission.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_network_interface_permissionsselectregionNetworkInterfacePermissionId, Filter, NextToken, MaxResultsDescribes the permissions for your network interfaces.
create_network_interface_permissioninsertNetworkInterfaceId, regionAwsAccountId, AwsService, Permission, DryRunGrants an Amazon Web Services-authorized account permission to attach the specified network interface to an instance in their account. You can grant permission to a single Amazon Web Services account only, and only one account at a time.
delete_network_interface_permissiondeleteNetworkInterfacePermissionId, regionForce, DryRunDeletes a permission for a network interface. By default, you cannot delete the permission if the account for which you're removing the permission has attached the network interface to an instance. However, you can force delete the permission, regardless of any attachment.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
NetworkInterfaceIdstringThe ID of the network interface.
NetworkInterfacePermissionIdstringThe ID of the network interface permission.
regionstringAWS region (default: us-east-1)
AwsAccountIdstringThe Amazon Web Services account ID.
AwsServicestringThe Amazon Web Services service. Currently not supported.
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayOne or more filters. network-interface-permission.network-interface-permission-id - The ID of the permission. network-interface-permission.network-interface-id - The ID of the network interface. network-interface-permission.aws-account-id - The Amazon Web Services account ID. network-interface-permission.aws-service - The Amazon Web Services service. network-interface-permission.permission - The type of permission (INSTANCE-ATTACH | EIP-ASSOCIATE).
ForcebooleanSpecify true to remove the permission even if the network interface is attached to an instance.
MaxResultsintegerThe maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. If this parameter is not specified, up to 50 results are returned by default. For more information, see Pagination.
NetworkInterfacePermissionIdarrayThe network interface permission IDs.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
PermissionstringThe type of permission to grant.

SELECT examples

Describes the permissions for your network interfaces.

SELECT
aws_account_id,
aws_service,
network_interface_id,
network_interface_permission_id,
permission,
permission_state
FROM aws.ec2.network_interface_permissions
WHERE region = '{{ region }}' -- required
AND NetworkInterfacePermissionId = '{{ NetworkInterfacePermissionId }}'
AND Filter = '{{ Filter }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;

INSERT examples

Grants an Amazon Web Services-authorized account permission to attach the specified network interface to an instance in their account. You can grant permission to a single Amazon Web Services account only, and only one account at a time.

INSERT INTO aws.ec2.network_interface_permissions (
NetworkInterfaceId,
region,
AwsAccountId,
AwsService,
Permission,
DryRun
)
SELECT
'{{ NetworkInterfaceId }}',
'{{ region }}',
'{{ AwsAccountId }}',
'{{ AwsService }}',
'{{ Permission }}',
'{{ DryRun }}'
RETURNING
aws_account_id,
aws_service,
network_interface_id,
network_interface_permission_id,
permission,
permission_state
;

DELETE examples

Deletes a permission for a network interface. By default, you cannot delete the permission if the account for which you're removing the permission has attached the network interface to an instance. However, you can force delete the permission, regardless of any attachment.

DELETE FROM aws.ec2.network_interface_permissions
WHERE NetworkInterfacePermissionId = '{{ NetworkInterfacePermissionId }}' --required
AND region = '{{ region }}' --required
AND Force = '{{ Force }}'
AND DryRun = '{{ DryRun }}'
;