Class: AWS::EC2::VPNConnectionCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::VPNConnectionCollection
- Includes:
- Core::Collection::Simple, TaggedCollection
- Defined in:
- lib/aws/ec2/vpn_connection_collection.rb
Instance Attribute Summary
Attributes included from Core::Model
Instance Method Summary collapse
-
#[](vpn_connection_id) ⇒ VPNConnection
Returns a reference to the VPN connection with the given id.
-
#create(options = {}) ⇒ VPNConnection
Creates a new VPN connection between an existing virtual private gateway and a VPN customer gateway.
Methods included from Core::Collection::Simple
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
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']
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.
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 = {} client_opts = {} client_opts[:customer_gateway_id] = customer_gateway_id() client_opts[:vpn_gateway_id] = vpn_gateway_id() client_opts[:type] = [: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 |