GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
VM::EC2::REST::security_group(3) User Contributed Perl Documentation VM::EC2::REST::security_group(3)
 

 use VM::EC2 ':standard';

The methods in this section allow you to query and manipulate security groups (firewall rules). See VM::EC2::SecurityGroup for functionality that is available through these objects.
Implemented:
AuthorizeSecurityGroupEgress (EC2-VPC only)
AuthorizeSecurityGroupIngress
CreateSecurityGroup
DeleteSecurityGroup
DescribeSecurityGroups
RevokeSecurityGroupEgress (EC2-VPC only)
RevokeSecurityGroupIngress
Unimplemented:
(none)

Searches for security groups (firewall rules) matching the provided filters and return a series of VM::EC2::SecurityGroup objects.
In the named-argument form you can provide the following optional arguments:
 -group_name      A single group name or an arrayref containing a list
                   of names
 -name            Shorter version of -group_name
 -group_id        A single group id (i.e. 'sg-12345') or an arrayref
                   containing a list of ids
 -filter          Filter on tags and other attributes.
The -filter argument name can be omitted if there are no other arguments you wish to pass.
The full list of security group filters can be found at: http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSecurityGroups.html

Create a security group. Arguments are:
 -group_name              Name of the security group (required)
 -group_description       Description of the security group (required)
 -vpc_id                  Virtual private cloud security group ID
                           (required for VPC security groups)
For convenience, you may use -name and -description as aliases for -group_name and -group_description respectively.
If succcessful, the method returns an object of type VM::EC2::SecurityGroup.

Delete a security group. Arguments are:
 -group_name              Name of the security group
 -group_id                ID of the security group
Either -group_name or -group_id is required. In the single-argument form, the method deletes the security group given by its id.
If succcessful, the method returns true.

Add one or more incoming firewall rules to a security group. The rules to add are stored in a VM::EC2::SecurityGroup which is created either by describe_security_groups() or create_security_group(). This method combines the actions AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.
For details, see VM::EC2::SecurityGroup. Here is a brief summary:
 $sg = $ec2->create_security_group(-name=>'MyGroup',-description=>'Example group');
 # TCP on port 80 for the indicated address ranges
 $sg->authorize_incoming(-protocol  => 'tcp',
                         -port      => 80,
                         -source_ip => ['192.168.2.0/24','192.168.2.1/24'});
 # TCP on ports 22 and 23 from anyone
 $sg->authorize_incoming(-protocol  => 'tcp',
                         -port      => '22..23',
                         -source_ip => '0.0.0.0/0');
 # ICMP on echo (ping) port from anyone
 $sg->authorize_incoming(-protocol  => 'icmp',
                         -port      => -1,
                         -source_ip => '0.0.0.0/0');
 # TCP to port 25 (mail) from instances belonging to
 # the "Mail relay" group belonging to user 12345678.
 $sg->authorize_incoming(-protocol  => 'tcp',
                         -port      => 25,
                         -group     => '12345678/Mail relay');
 $result = $ec2->update_security_group($sg);
or more simply:
 $result = $sg->update();

VM::EC2

Lincoln Stein <lincoln.stein@gmail.com>.
Copyright (c) 2011 Ontario Institute for Cancer Research
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.
2019-01-01 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.