Class: AWS::EC2::VPNConnectionCollection

Inherits:
Collection
  • Object
show all
Includes:
Core::Collection::Simple, TaggedCollection
Defined in:
lib/aws/ec2/vpn_connection_collection.rb

Instance Attribute Summary

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods included from Core::Collection::Simple

#each_batch

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Methods included from Core::Model

#client, #config_prefix, #initialize, #inspect

Methods included from TaggedCollection

#tagged, #tagged_values

Methods included from FilteredCollection

#filter, #filtered_request, #initialize

Instance Method Details

#[](vpn_connection_id) ⇒ VPNConnection

Returns a reference to the VPN connection with the given id.

vpn_connection = ec2.vpn_connections['vpn-connection-id']

Parameters:

  • vpn_connection_id (String)

Returns:


60
61
62
# File 'lib/aws/ec2/vpn_connection_collection.rb', line 60

def [] vpn_connection_id
  VPNConnection.new(vpn_connection_id, :config => config)
end

#create(options = {}) ⇒ VPNConnection

Creates a new VPN connection between an existing virtual private gateway and a VPN customer gateway.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

Returns:


38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/aws/ec2/vpn_connection_collection.rb', line 38

def create options = {}
  
  client_opts = {}
  client_opts[:customer_gateway_id] = customer_gateway_id(options)
  client_opts[:vpn_gateway_id] = vpn_gateway_id(options)
  client_opts[:type] = options[:vpn_type] || 'ipsec.1'

  resp = client.create_vpn_connection(client_opts)

  VPNConnection.new_from(:create_vpn_connection, resp,
    resp.vpn_connection.vpn_connection_id, :config => config)

end