class AWS::EC2::VPNGateway

def attach vpc

Returns:
  • (Attachment) -

Parameters:
  • vpc (VPC, String) -- A {VPC} object or a vpc id string.
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

def attachments

Returns:
  • (Array) -
def attachments
  attachment_set.map {|details| Attachment.new(self, details) }
end

def delete

Returns:
  • (nil) -
def delete
  client_opts = {}
  client_opts[:vpn_gateway_id] = vpn_gateway_id
  client.delete_vpn_gateway(client_opts)
  nil
end

def detach vpc

Returns:
  • (nil) -

Parameters:
  • vpc (VPC, String) -- A {VPC} object or a vpc id string.
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

def exists?

Returns:
  • (Boolean) - Returns true if the gateway exists.
def exists?
  begin
    client.describe_vpn_gateways(:vpn_gateway_ids => [id])
    true
  rescue Errors::InvalidVPNGatewayID::NotFound
    false
  end
end

def initialize vpn_gateway_id, options = {}

def initialize vpn_gateway_id, options = {}
  @vpn_gateway_id = vpn_gateway_id
  super
end

def vpc

Returns:
  • (VPC, nil) - Returns the currently attached VPC, or nil
def vpc
  if attachment = attachments.first
    attachment.vpc
  end
end

def vpc_id vpc

def vpc_id vpc
  vpc.is_a?(VPC) ? vpc.vpc_id : vpc
end

def vpn_connections

Returns:
  • (VPNConnectionCollection) - Returns a collection
def vpn_connections
  connections = VPNConnectionCollection.new(:config => config)
  connections.filter('vpn-gateway-id', id)
end