Class: AWS::EC2::CustomerGatewayCollection

Inherits:
Collection
  • Object
show all
Includes:
Core::Collection::Simple, TaggedCollection
Defined in:
lib/aws/ec2/customer_gateway_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

#[](customer_gateway_id) ⇒ CustomerGateway

Parameters:

  • customer_gateway_id (String)

Returns:



53
54
55
# File 'lib/aws/ec2/customer_gateway_collection.rb', line 53

def [] customer_gateway_id
  CustomerGateway.new(customer_gateway_id, :config => config)
end

#create(bgp_asn, ip_address, options = {}) ⇒ CustomerGateway

Parameters:

  • bgp_asn (Integer)

    The customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).

  • ip_address (String)

    The Internet-routable IP address for the customer gateway’s outside interface. The address must be static.

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

Options Hash (options):

  • :vpn_type (String) — default: 'ipsec.1'

    The type of VPN connection this customer gateway supports.

Returns:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/aws/ec2/customer_gateway_collection.rb', line 35

def create bgp_asn, ip_address, options = {}

  client_opts = {}
  client_opts[:bgp_asn] = bgp_asn
  client_opts[:public_ip] = ip_address
  client_opts[:type] = options[:vpn_type] || 'ipsec.1'

  resp = client.create_customer_gateway(client_opts)

  CustomerGateway.new_from(:create_customer_gateway, 
    resp.customer_gateway,
    resp.customer_gateway.customer_gateway_id,
    :config => config)

end