AWS-IP
view release on metacpan or search on metacpan
lib/AWS/IP.pm view on Meta::CPAN
# validate args
unless ($cache_timeout_secs
&& $cache_timeout_secs =~ /^[0-9]+$/)
{
croak 'Error argument cache_timeout_secs must be a positive integer';
}
bless {
cache => Cache::File->new( cache_root => ($cache_path || tempdir()),
lock_level => Cache::File::LOCK_LOCAL(),
default_expires => "$cache_timeout_secs sec"),
}, $class;
}
=head2 ip_is_aws ($ip, [$service])
Boolean method to test if an ip address is from AWS. Optionally takes a service name (AMAZON|EC2|CLOUDFRONT|ROUTE53|ROUTE53_HEALTHCHECKS) and restricts the check to AWS ip addresses for that service.
If you are checking more than one ip address, it's more efficient to pull the CIDRs you want, then use L<Net::CIDR::Set> to test if the ips are present in the CIDRs (see example in SYNOPSIS).
=cut
( run in 0.585 second using v1.01-cache-2.11-cpan-0a6323c29d9 )