| 1 | package Net::Amazon::EC2::IpPermission; | ||
| 2 | 2 | $Net::Amazon::EC2::IpPermission::VERSION = '0.36'; | |
| 3 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Net::Amazon::EC2::IpPermission | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | A class representing a rule within the security group. | ||
| 12 | |||
| 13 | =head1 ATTRIBUTES | ||
| 14 | |||
| 15 | =over | ||
| 16 | |||
| 17 | =item ip_protocol (required) | ||
| 18 | |||
| 19 | Protocol for the rule. e.g. tcp | ||
| 20 | |||
| 21 | =item from_port (required) | ||
| 22 | |||
| 23 | Start of port range for the TCP and UDP protocols, or an | ||
| 24 | ICMP type number. An ICMP type number of -1 indicates a | ||
| 25 | wildcard (i.e., any ICMP type number). | ||
| 26 | |||
| 27 | =item to_port (required) | ||
| 28 | |||
| 29 | End of port range for the TCP and UDP protocols, or an | ||
| 30 | ICMP code. An ICMP code of -1 indicates a wildcard (i.e., | ||
| 31 | any ICMP code). | ||
| 32 | |||
| 33 | =item ip_ranges (optional) | ||
| 34 | |||
| 35 | An array ref of Net::Amazon::EC2::IpRange objects to be associated with this rule. | ||
| 36 | |||
| 37 | =item groups (optional) | ||
| 38 | |||
| 39 | An array ref of Net::Amazon::EC2::UserIdGroupPair objects to be associated with this rule. | ||
| 40 | |||
| 41 | =item icmp_port (optional) | ||
| 42 | |||
| 43 | For the ICMP protocol, the ICMP type and code must be specified. This must be specified in the format type:code where both are integers. Type, code, | ||
| 44 | or both can be specified as -1, which is a wildcard. | ||
| 45 | |||
| 46 | =back | ||
| 47 | |||
| 48 | =cut | ||
| 49 | |||
| 50 | 2 | has 'ip_protocol' => ( is => 'ro', isa => 'Str', required => 1 ); | |
| 51 | 2 | has 'from_port' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 ); | |
| 52 | 2 | has 'to_port' => ( is => 'ro', isa => 'Maybe[Int]', required => 1 ); | |
| 53 | 2 | has 'ip_ranges' => ( | |
| 54 | is => 'rw', | ||
| 55 | isa => 'ArrayRef[Net::Amazon::EC2::IpRange]', | ||
| 56 | predicate => 'has_ip_ranges', | ||
| 57 | required => 0, | ||
| 58 | ); | ||
| 59 | 2 | has 'groups' => ( | |
| 60 | is => 'rw', | ||
| 61 | isa => 'ArrayRef[Net::Amazon::EC2::UserIdGroupPair]', | ||
| 62 | predicate => 'has_groups', | ||
| 63 | required => 0, | ||
| 64 | ); | ||
| 65 | 2 | has 'icmp_port' => ( is => 'ro', isa => 'Maybe[Str]', required => 0 ); | |
| 66 | |||
| 67 | 2 | __PACKAGE__->meta->make_immutable(); | |
| 68 | |||
| 69 | =head1 AUTHOR | ||
| 70 | |||
| 71 | Jeff Kim <cpan@chosec.com> | ||
| 72 | |||
| 73 | =head1 COPYRIGHT | ||
| 74 | |||
| 75 | Copyright (c) 2006-2010 Jeff Kim. This program is free software; you can redistribute it and/or modify it | ||
| 76 | under the same terms as Perl itself. | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | 2 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 81 | 2 | 1; | |