VM::EC...orkAcl(3pm)

πŸ“¦
version 1.28 Β· 7 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– VM::EC2::VPC::NetworkAcl πŸ’–

okay bestie, welcome to the manual page for VM::EC2::VPC::NetworkAcl β€” that's the Perl module, and yeah we're chilling in section 3pm because that's where the Perl docs live. Buckle up, this one's a whole mood. πŸ¦‹


🌸 NAME 🌸

VM::EC2::VPC::NetworkAcl β€” Virtual Private Cloud network ACL. That's it, that's the vibe. πŸ’…


✨ SYNOPSIS ✨

okay so here's the whole flow, no cap:

use VM::EC2;

my $ec2      = VM::EC2->new(...);
my @acls     = $ec2->describe_network_acls(-network_acl_id=>'acl-12345678');
 foreach my $acl (@acls) {
     my $vpc_id  = $acl->vpcId;
     my $default = $acl->default;
     my @entries = $acl->entries;
     my @assoc   = $acl->associations;
     ...
 }

my $acl      = $ec2->create_network_acl_entry(...);

literally just grab your $ec2, pull the ACLs, and then read every single little property off them like the nosy icon you are. πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

This object is the whole entire glow-up of an Amazon EC2 VPC network ACL. When you call VM::EC2->describe_network_acls() or VM::EC2->create_network_acl(), this is the baby you get handed back. She's the main character of your subnet rules. πŸ‘‘


🧚 METHODS 🧚

These object methods are supported, bestie β€” read 'em and weep (affectionately):

  • networkAclId β€” The network ACL's ID.
  • vpcId β€” The ID of the VPC the network ACL is in.
  • default β€” Whether this is the default network ACL in the VPC.
  • entrySet β€” A list of entries (rules) in the network ACL.
  • associationSet β€” A list of associations between the network ACL and one or more subnets.
  • tagSet β€” Tags assigned to the resource.
  • associations β€” Alias for associationSet.
  • entries β€” Alias for entrySet.

The object also supports the tags() method described in VM::EC2::Generic. slay, inherited behavior. πŸ’œ


πŸ”₯ CONVENIENCE METHODS πŸ”₯

πŸ’« $success = $acl->create_entry(%args)

πŸ’« $success = $acl->create_entry($acl_entry)

Creates an entry (i.e., rule) in a network ACL with the rule number you specified. 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, Amazon VPC processes the entries in the ACL according to the rule numbers, in ascending order.

fr fr, order matters here β€” ascending rule numbers, that's the whole plot.

Arguments, and yes every single one is required unless it says otherwise:

  • -rule_number β€” Rule number to assign to the entry (e.g., 100). ACL entries are processed in ascending order by rule number. Positive integer from 1 to 32766. (Required)
  • -protocol β€” The IP protocol the rule applies to. You can use -1 to mean all protocols. See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml for a list of protocol numbers. (Required)
  • -rule_action β€” Indicates whether to allow or deny traffic that matches the rule. allow | deny (Required)
  • -egress β€” Indicates whether this rule applies to egress traffic from the subnet (true) or ingress traffic to the subnet (false). Default is false.
  • -cidr_block β€” The CIDR range to allow or deny, in CIDR notation (e.g., 172.16.0.0/24). (Required)
  • -icmp_code β€” For the ICMP protocol, the ICMP code. You can use -1 to specify all ICMP codes for the given ICMP type. Required if specifying 1 (ICMP) for protocol.
  • -icmp_type β€” For the ICMP protocol, the ICMP type. You can use -1 to specify all ICMP types. Required if specifying 1 (ICMP) for the protocol
  • -port_from β€” The first port in the range. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.
  • -port_to β€” The last port in the range. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.

Alternately, you can pass an existing ACL entry object VM::EC2::VPC::NetworkAcl::Entry as the only argument, which is the move for copying entries from one ACL to another. chef's kiss. 🫢

Returns true on successful creation.


πŸ’« $success = $acl->delete_entry(%args)

πŸ’« $success = $acl->delete_entry($acl_entry)

Deletes an ingress or egress entry (i.e., rule) from a network ACL. bye bestie πŸ’€

Arguments:

  • -network_acl_id β€” ID of the ACL where the entry will be created
  • -rule_number β€” Rule number of the entry (e.g., 100).

Optional arguments:

  • -egress β€” Whether the rule to delete is an egress rule (true) or ingress rule (false). Default is false.

Alternately, you can pass an existing ACL entry object VM::EC2::VPC::NetworkAcl::Entry as the only argument to ease deletion of entries.

Returns true on successful deletion.


πŸ’« $success = replace_entry(%args)

πŸ’« $success = replace_entry($acl_entry)

Replaces an entry (i.e., rule) in a network ACL. out with the old, in with the new ✨

Arguments:

  • -network_acl_id β€” ID of the ACL where the entry will be created (Required)
  • -rule_number β€” Rule number of the entry to replace. (Required)
  • -protocol β€” The IP protocol the rule applies to. You can use -1 to mean all protocols. See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml for a list of protocol numbers. (Required)
  • -rule_action β€” Indicates whether to allow or deny traffic that matches the rule. allow | deny (Required)
  • -egress β€” Indicates whether this rule applies to egress traffic from the subnet (true) or ingress traffic to the subnet (false). Default is false.
  • -cidr_block β€” The CIDR range to allow or deny, in CIDR notation (e.g., 172.16.0.0/24). (Required)
  • -icmp_code β€” For the ICMP protocol, the ICMP code. You can use -1 to specify all ICMP codes for the given ICMP type. Required if specifying 1 (ICMP) for protocol.
  • -icmp_type β€” For the ICMP protocol, the ICMP type. You can use -1 to specify all ICMP types. Required if specifying 1 (ICMP) for the protocol
  • -port_from β€” The first port in the range. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.
  • -port_to β€” The last port in the range. Only required if specifying 6 (TCP) or 17 (UDP) for the protocol and is a different port than -port_from.

Alternately, you can pass an existing ACL entry object VM::EC2::VPC::NetworkAcl::Entry as the only argument for ease in replacing entries from one ACL to another. The rule number in the passed entry object must already exist in the ACL.

⚠️ heads up bestie: that rule number has to already exist in the ACL or this whole thing is a no. πŸ’€

Returns true on successful replacement.


πŸ’« $association_id = $acl->associate($subnet_id)

Associates the ACL with a subnet in the same VPC. Replaces whatever ACL the subnet was associated with previously.

not me just casually yeeting the old association into the sun πŸ™ˆ

πŸ’« $association_id = $acl->disassociate($subnet_id)

Disassociates the ACL with a subnet in the same VPC. The subnet will then be associated with the default ACL.


🌈 STRING OVERLOADING 🌈

When used in a string context, this object will interpolate the networkAclId. so if you just print her, you get the ID. iconic behavior honestly. ⭐


πŸ’œ SEE ALSO πŸ’œ

  • VM::EC2
  • VM::EC2::Generic
  • VM::EC2::Tag
  • VM::EC2::VPC
  • VM::EC2::VPC::NetworkAcl::Entry
  • VM::EC2::VPC::NetworkAcl::Association

πŸ‘‘ AUTHOR πŸ‘‘

Lance Kinley <lkinley@loyaltymethods.com>.

Copyright (c) 2012 Loyalty Methods, Inc.

This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.


and that's the whole page, bestie πŸŽ€ this lil doc was brought to you by perl v5.38.2, dated 2024-08-10 β€” go forth and ACL responsibly, ily, bye πŸ¦‹πŸ’–

πŸ“¦ where this page comes from