VM::EC...::Entry(3pm)
π VM::EC2::VPC::NetworkAcl::Entry β ok so bestie, let's talk network ACL entries π
This is the page for VM::EC2::VPC::NetworkAcl::Entry(3pm), straight out of the User Contributed Perl Documentation. It's giving very specific, very powerful, very "your VPC firewall rules but make it an object" energy. Let's get into it. β¨
πΈ NAME πΈ
VM::EC2::VPC::NetworkAcl::Entry β a VPC Network ACL entry. That's it, that's the whole vibe. One entry, one rule, one little bouncer for your subnet traffic. π«Ά
β¨ SYNOPSIS β¨
Okay so here's how you actually use it, no cap:
use VM::EC2;
my $ec2 = VM::EC2->new(...);
my $acl = $ec2->describe_network_acls(-network_acl_id=>'acl-12345678');
my @entries = $acl->entries;
# print outgoing icmp rules
for my $e (@entries) {
if ($e->egress && $e->protocol == 1) { # icmp = 1
print $e->ruleNumber,"\n",
$e->ruleAction,"\n",
$e->cidrBlock,"\n",
$e->icmpType,"\n",
$e->icmpCode,"\n";
}
}
# print incoming tcp rules
for my $e (@entries) {
if (! $e->egress && $e->protocol == 6) { # tcp = 6
print $e->ruleNumber,"\n",
$e->ruleAction,"\n",
$e->cidrBlock,"\n",
$e->port_from,'-',$e->port_to,"\n";
}
}
Like, you spin up a VM::EC2 object, grab your ACL by its -network_acl_id, pull the entries, and then loop through them filtering on egress and protocol. ICMP is 1, TCP is 6, iykyk. π
π¦ DESCRIPTION π¦
This object represents an Amazon EC2 VPC network ACL entry. That's the whole thing β it's the lil object wrapper for one single rule inside a network ACL. Main character energy for a firewall rule, honestly. π
π METHODS π
These object methods are supported β every single one, we're not skipping anybody:
ruleNumberβ the specific rule number for the entry. Heads up bestie, ACL entries are processed in ascending order by rule number, so the order literally matters. π’protocolβ the protocol. A value of-1means all protocols. There's a whole list athttp://www.iana.org/assignments/protocol-numbers/protocol-numbers.xmlif you wanna go look up protocol numbers, which, honestly, iconic of you. πruleActionβ whether to allow or deny the traffic that matches the rule. Valid values:allow | deny. It's giving yes or no, no in-between. βοΈegressβ boolean flag to indicate an egress rule (rule is applied to traffic leaving the subnet). A value of true indicates egress. πͺcidrBlockβ the network range to allow or deny, in CIDR notation. π§icmpTypeβ for the ICMP protocol, this is the ICMP type.icmpCodeβ for the ICMP protocol, this is the ICMP code.portRangeFromβ for the TCP or UDP protocols, the starting range of ports the rule applies to.portRangeToβ for the TCP or UDP protocols, the ending range of ports the rule applies to.port_fromβ alias forportRangeFrom. Same thing, cuter name. πport_toβ alias forportRangeTo. Also same thing, also cuter name. π
The object also supports the tags() method described in VM::EC2::Generic β so yes, you can tag it, go off. π·οΈ
π STRING OVERLOADING π
When used in a string context, this object will interpolate the rule number. So if you just shove it into a string, boom, you get the rule number. That's it. Not me being obsessed with a one-line feature but here we are. π«
π SEE ALSO π
Go read these too, besties:
VM::EC2 VM::EC2::Generic VM::EC2::Tag VM::EC2::VPC VM::EC2::VPC::NetworkAcl
π 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.
fr fr read the LICENSE and DISCLAIMER.txt, they're the receipts. π§Ύ
And that's the whole page, bestie β this one shipped with perl v5.38.2 and it's dated 2024-08-10. Go forth and rule your subnets. Slay. π
β¨
π¦ where this page comes from
- debian trixie: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu resolute: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- ubuntu stonking: libvm-ec2-perl 1.28-5 Β· Artistic-2.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms