network_acls
Creates, updates, deletes, gets or lists a network_acls resource.
Overview
| Name | network_acls |
| Type | Resource |
| Id | aws.ec2.network_acls |
Fields
The following fields are returned by SELECT queries:
- describe_network_acls
| Name | Datatype | Description |
|---|---|---|
associations | string | Any associations between the network ACL and your subnets |
entries | string | The entries (rules) in the network ACL. |
is_default | boolean | Indicates whether this is the default network ACL for the VPC. |
network_acl_id | string | The ID of the network ACL. |
owner_id | string | The ID of the Amazon Web Services account that owns the network ACL. |
tags | string | Any tags assigned to the network ACL. |
vpc_id | string | The ID of the VPC for the network ACL. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_network_acls | select | region | NextToken, MaxResults, DryRun, NetworkAclId, Filter | Describes your network ACLs. The default is to describe all your network ACLs. Alternatively, you can specify specific network ACL IDs or filter the results to include only the network ACLs that match specific criteria. For more information, see Network ACLs in the Amazon VPC User Guide. |
create_network_acl_entry | insert | NetworkAclId, RuleNumber, RuleAction, Egress, region | DryRun, Protocol, CidrBlock, Ipv6CidrBlock, Icmp, PortRange | Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules. We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules. After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one. For more information about network ACLs, see Network ACLs in the Amazon VPC User Guide. |
create_network_acl | insert | VpcId, region | TagSpecification, ClientToken, DryRun | Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC. For more information, see Network ACLs in the Amazon VPC User Guide. |
replace_network_acl_entry | replace | NetworkAclId, RuleNumber, RuleAction, Egress, region | DryRun, Protocol, CidrBlock, Ipv6CidrBlock, Icmp, PortRange | Replaces an entry (rule) in a network ACL. For more information, see Network ACLs in the Amazon VPC User Guide. |
replace_network_acl_association | replace | AssociationId, NetworkAclId, region | DryRun | Changes which network ACL a subnet is associated with. By default when you create a subnet, it's automatically associated with the default network ACL. For more information, see Network ACLs in the Amazon VPC User Guide. This is an idempotent operation. |
delete_network_acl_entry | delete | NetworkAclId, RuleNumber, Egress, region | DryRun | Deletes the specified ingress or egress entry (rule) from the specified network ACL. |
delete_network_acl | delete | NetworkAclId, region | DryRun | Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL. |
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 |
|---|---|---|
AssociationId | string | The ID of the current association between the original network ACL and the subnet. |
Egress | boolean | Indicates whether the rule is an egress rule. |
NetworkAclId | string | The ID of the network ACL. |
RuleAction | string | Indicates whether to allow or deny the traffic that matches the rule. |
RuleNumber | integer | The rule number of the entry to delete. |
VpcId | string | The ID of the VPC. |
region | string | AWS region (default: us-east-1) |
CidrBlock | string | The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). |
ClientToken | string | Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency. |
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 | The filters. association.association-id - The ID of an association ID for the ACL. association.network-acl-id - The ID of the network ACL involved in the association. association.subnet-id - The ID of the subnet involved in the association. default - Indicates whether the ACL is the default network ACL for the VPC. entry.cidr - The IPv4 CIDR range specified in the entry. entry.icmp.code - The ICMP code specified in the entry, if any. entry.icmp.type - The ICMP type specified in the entry, if any. entry.ipv6-cidr - The IPv6 CIDR range specified in the entry. entry.port-range.from - The start of the port range specified in the entry. entry.port-range.to - The end of the port range specified in the entry. entry.protocol - The protocol specified in the entry (tcp | udp | icmp or a protocol number). entry.rule-action - Allows or denies the matching traffic (allow | deny). entry.egress - A Boolean that indicates the type of rule. Specify true for egress rules, or false for ingress rules. entry.rule-number - The number of an entry (in other words, rule) in the set of ACL entries. network-acl-id - The ID of the network ACL. owner-id - The ID of the Amazon Web Services account that owns the network ACL. tag - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value. vpc-id - The ID of the VPC for the network ACL. |
Icmp | object | ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block. |
Ipv6CidrBlock | string | The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8🔢1a00::/64). |
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. For more information, see Pagination. |
NetworkAclId | array | The IDs of the network ACLs. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
PortRange | object | TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP). |
Protocol | string | The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code. |
TagSpecification | array | The tags to assign to the network ACL. |
SELECT examples
- describe_network_acls
Describes your network ACLs. The default is to describe all your network ACLs. Alternatively, you can specify specific network ACL IDs or filter the results to include only the network ACLs that match specific criteria. For more information, see Network ACLs in the Amazon VPC User Guide.
SELECT
associations,
entries,
is_default,
network_acl_id,
owner_id,
tags,
vpc_id
FROM aws.ec2.network_acls
WHERE region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND DryRun = '{{ DryRun }}'
AND NetworkAclId = '{{ NetworkAclId }}'
AND Filter = '{{ Filter }}'
;
INSERT examples
- create_network_acl_entry
- create_network_acl
- Manifest
Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules. We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules. After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one. For more information about network ACLs, see Network ACLs in the Amazon VPC User Guide.
INSERT INTO aws.ec2.network_acls (
NetworkAclId,
RuleNumber,
RuleAction,
Egress,
region,
DryRun,
Protocol,
CidrBlock,
Ipv6CidrBlock,
Icmp,
PortRange
)
SELECT
'{{ NetworkAclId }}',
'{{ RuleNumber }}',
'{{ RuleAction }}',
'{{ Egress }}',
'{{ region }}',
'{{ DryRun }}',
'{{ Protocol }}',
'{{ CidrBlock }}',
'{{ Ipv6CidrBlock }}',
'{{ Icmp }}',
'{{ PortRange }}'
;
Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC. For more information, see Network ACLs in the Amazon VPC User Guide.
INSERT INTO aws.ec2.network_acls (
VpcId,
region,
TagSpecification,
ClientToken,
DryRun
)
SELECT
'{{ VpcId }}',
'{{ region }}',
'{{ TagSpecification }}',
'{{ ClientToken }}',
'{{ DryRun }}'
RETURNING
associations,
entries,
is_default,
network_acl_id,
owner_id,
tags,
vpc_id
;
# Description fields are for documentation purposes
- name: network_acls
props:
- name: NetworkAclId
value: "{{ NetworkAclId }}"
description: Required parameter for the network_acls resource.
- name: RuleNumber
value: {{ RuleNumber }}
description: Required parameter for the network_acls resource.
- name: RuleAction
value: "{{ RuleAction }}"
description: Required parameter for the network_acls resource.
- name: Egress
value: {{ Egress }}
description: Required parameter for the network_acls resource.
- name: region
value: "{{ region }}"
description: Required parameter for the network_acls resource.
- name: VpcId
value: "{{ VpcId }}"
description: Required parameter for the network_acls resource.
- 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.
- name: Protocol
value: "{{ Protocol }}"
description: The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.
description: The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.
- name: CidrBlock
value: "{{ CidrBlock }}"
description: The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
description: The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
- name: Ipv6CidrBlock
value: "{{ Ipv6CidrBlock }}"
description: The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64).
description: The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64).
- name: Icmp
value: "{{ Icmp }}"
description: ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
description: ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
- name: PortRange
value: "{{ PortRange }}"
description: TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).
description: TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to assign to the network ACL.
description: The tags to assign to the network ACL.
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
REPLACE examples
- replace_network_acl_entry
- replace_network_acl_association
Replaces an entry (rule) in a network ACL. For more information, see Network ACLs in the Amazon VPC User Guide.
REPLACE aws.ec2.network_acls
SET
-- No updatable properties
WHERE
NetworkAclId = '{{ NetworkAclId }}' --required
AND RuleNumber = '{{ RuleNumber }}' --required
AND RuleAction = '{{ RuleAction }}' --required
AND Egress = '{{ Egress }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
AND Protocol = '{{ Protocol}}'
AND CidrBlock = '{{ CidrBlock}}'
AND Ipv6CidrBlock = '{{ Ipv6CidrBlock}}'
AND Icmp = '{{ Icmp}}'
AND PortRange = '{{ PortRange}}';
Changes which network ACL a subnet is associated with. By default when you create a subnet, it's automatically associated with the default network ACL. For more information, see Network ACLs in the Amazon VPC User Guide. This is an idempotent operation.
REPLACE aws.ec2.network_acls
SET
-- No updatable properties
WHERE
AssociationId = '{{ AssociationId }}' --required
AND NetworkAclId = '{{ NetworkAclId }}' --required
AND region = '{{ region }}' --required
AND DryRun = {{ DryRun}}
RETURNING
new_association_id;
DELETE examples
- delete_network_acl_entry
- delete_network_acl
Deletes the specified ingress or egress entry (rule) from the specified network ACL.
DELETE FROM aws.ec2.network_acls
WHERE NetworkAclId = '{{ NetworkAclId }}' --required
AND RuleNumber = '{{ RuleNumber }}' --required
AND Egress = '{{ Egress }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;
Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL.
DELETE FROM aws.ec2.network_acls
WHERE NetworkAclId = '{{ NetworkAclId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;