network_interface_permissions
Creates, updates, deletes, gets or lists a network_interface_permissions resource.
Overview
| Name | network_interface_permissions |
| Type | Resource |
| Id | aws.ec2.network_interface_permissions |
Fields
The following fields are returned by SELECT queries:
- describe_network_interface_permissions
| Name | Datatype | Description |
|---|---|---|
aws_account_id | string | The Amazon Web Services account ID. |
aws_service | string | The Amazon Web Services service. |
network_interface_id | string | The ID of the network interface. |
network_interface_permission_id | string | The ID of the network interface permission. |
permission | string | The type of permission. |
permission_state | string | Information about the state of the permission. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_network_interface_permissions | select | region | NetworkInterfacePermissionId, Filter, NextToken, MaxResults | Describes the permissions for your network interfaces. |
create_network_interface_permission | insert | NetworkInterfaceId, region | AwsAccountId, AwsService, Permission, DryRun | 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. |
delete_network_interface_permission | delete | NetworkInterfacePermissionId, region | Force, DryRun | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
NetworkInterfaceId | string | The ID of the network interface. |
NetworkInterfacePermissionId | string | The ID of the network interface permission. |
region | string | AWS region (default: us-east-1) |
AwsAccountId | string | The Amazon Web Services account ID. |
AwsService | string | The Amazon Web Services service. Currently not supported. |
DryRun | boolean | Checks 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. |
Filter | array | One 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). |
Force | boolean | Specify true to remove the permission even if the network interface is attached to an instance. |
MaxResults | integer | The 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. |
NetworkInterfacePermissionId | array | The network interface permission IDs. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
Permission | string | The type of permission to grant. |
SELECT examples
- describe_network_interface_permissions
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
- create_network_interface_permission
- Manifest
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
;
# Description fields are for documentation purposes
- name: network_interface_permissions
props:
- name: NetworkInterfaceId
value: "{{ NetworkInterfaceId }}"
description: Required parameter for the network_interface_permissions resource.
- name: region
value: "{{ region }}"
description: Required parameter for the network_interface_permissions resource.
- name: AwsAccountId
value: "{{ AwsAccountId }}"
description: The Amazon Web Services account ID.
description: The Amazon Web Services account ID.
- name: AwsService
value: "{{ AwsService }}"
description: The Amazon Web Services service. Currently not supported.
description: The Amazon Web Services service. Currently not supported.
- name: Permission
value: "{{ Permission }}"
description: The type of permission to grant.
description: The type of permission to grant.
- name: DryRun
value: {{ DryRun }}
description: Checks 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.
description: Checks 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.
DELETE examples
- delete_network_interface_permission
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 }}'
;