The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME VM::EC2::REST::internet_gateway

SYNOPSIS

 use VM::EC2 ':vpc'

METHODS

These methods provide methods for creating, associating and deleting Internet Gateway objects.

Implemented: AttachInternetGateway CreateInternetGateway DeleteInternetGateway DescribeInternetGateways DetachInternetGateway

Unimplemented: (none)

$gateway = $ec2->create_internet_gateway()

This method creates a new Internet gateway. It takes no arguments and returns a VM::EC2::VPC::InternetGateway object. Gateways are initially independent of any VPC, but later can be attached to one or more VPCs using attach_internet_gateway().

$success = $ec2->delete_internet_gateway($internet_gateway_id)

$success = $ec2->delete_internet_gateway(-internet_gateway_id=>$id)

This method deletes the indicated internet gateway. It may be called with a single argument corresponding to the route table's ID, or using the named form with argument -internet_gateway_id.

@gateways = $ec2->describe_internet_gateways(@gateway_ids)

@gateways = $ec2->describe_internet_gateways(\%filters)

@gateways = $ec2->describe_internet_gateways(-internet_gateway_id=>\@ids, -filter =>\$filters)

This method describes all or some of the internet gateways available to you. You may use the filter to restrict the search to a particular type of internet gateway using one or more of the filters described at http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInternetGateways.html.

Some of the commonly used filters are:

 attachment.vpc-id       ID of one of the VPCs the gateway is attached to
 attachment.state        State of the gateway, always "available"
 tag:<key>               Value of a tag

On success this method returns a list of VM::EC2::VPC::InternetGateway objects.

$boolean = $ec2->attach_internet_gateway($internet_gateway_id,$vpc_id)

$boolean = $ec2->attach_internet_gateway(-internet_gateway_id => $id, -vpc_id => $id)

This method attaches an internet gateway to a VPC. You can use internet gateway and VPC IDs, or their corresponding VM::EC2::VPC::InternetGateway and VM::EC2::VPC objects.

Required arguments:

 -internet_gateway_id ID of the network interface to attach.
 -vpc_id              ID of the instance to attach the interface to.

On success, this method a true value.

Note that it may be more convenient to attach and detach gateways via methods in the VM::EC2::VPC and VM::EC2::VPC::Gateway objects.

 $vpc->attach_internet_gateway($gateway);
 $gateway->attach($vpc);

$boolean = $ec2->detach_internet_gateway($internet_gateway_id,$vpc_id)

$boolean = $ec2->detach_internet_gateway(-internet_gateway_id => $id, -vpc_id => $id)

This method detaches an internet gateway to a VPC. You can use internet gateway and VPC IDs, or their corresponding VM::EC2::VPC::InternetGateway and VM::EC2::VPC objects.

Required arguments:

 -internet_gateway_id ID of the network interface to detach.
 -vpc_id              ID of the VPC to detach the gateway from.

On success, this method a true value.

Note that it may be more convenient to detach and detach gateways via methods in the VM::EC2::VPC and VM::EC2::VPC::Gateway objects.

 $vpc->detach_internet_gateway($gateway);
 $gateway->detach($vpc);

SEE ALSO

VM::EC2

AUTHOR

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.