@return [String]
@return [String]
# File lib/aws/ec2/vpn_gateway.rb, line 23 def initialize vpn_gateway_id, options = {} @vpn_gateway_id = vpn_gateway_id super end
Attaches this vpn gateway to the given VPC. @param [VPC,String] vpc A {VPC} object or a vpc id string. @return [Attachment]
# File lib/aws/ec2/vpn_gateway.rb, line 67 def attach vpc client_opts = {} client_opts[:vpn_gateway_id] = vpn_gateway_id client_opts[:vpc_id] = vpc_id(vpc) resp = client.attach_vpn_gateway(client_opts) Attachment.new(self, resp.attachment) end
@return [Array<VPNGateway::Attachment>]
# File lib/aws/ec2/vpn_gateway.rb, line 52 def attachments attachment_set.map {|details| Attachment.new(self, details) } end
Deletes this vpn gateway. @return [nil]
# File lib/aws/ec2/vpn_gateway.rb, line 99 def delete client_opts = {} client_opts[:vpn_gateway_id] = vpn_gateway_id client.delete_vpn_gateway(client_opts) nil end
Detaches this vpn gateway from the given VPC. @param [VPC,String] vpc A {VPC} object or a vpc id string. @return [nil]
# File lib/aws/ec2/vpn_gateway.rb, line 82 def detach vpc client_opts = {} client_opts[:vpn_gateway_id] = vpn_gateway_id client_opts[:vpc_id] = vpc_id(vpc) client.detach_vpn_gateway(client_opts) nil end
@return [Boolean] Returns true if the gateway exists.
# File lib/aws/ec2/vpn_gateway.rb, line 107 def exists? begin client.describe_vpn_gateways(:vpn_gateway_ids => [id]) true rescue Errors::InvalidVPNGatewayID::NotFound false end end
@return [VPNConnectionCollection] Returns a collection
of VPC connections for this gateway.
# File lib/aws/ec2/vpn_gateway.rb, line 92 def vpn_connections connections = VPNConnectionCollection.new(:config => config) connections.filter('vpn-gateway-id', id) end
# File lib/aws/ec2/vpn_gateway.rb, line 117 def vpc_id vpc vpc.is_a?(VPC) ? vpc.vpc_id : vpc end