Class: AWS::EC2::VPNGatewayCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::VPNGatewayCollection
- Includes:
- Core::Collection::Simple, TaggedCollection
- Defined in:
- lib/aws/ec2/vpn_gateway_collection.rb
Instance Attribute Summary
Attributes included from Core::Model
Instance Method Summary collapse
- #[](vpn_gateway_id) ⇒ VPNGateway
-
#create(options = {}) ⇒ VPNGateway
Creates a new virtual private 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_gateway_id) ⇒ VPNGateway
57 58 59 |
# File 'lib/aws/ec2/vpn_gateway_collection.rb', line 57 def [] vpn_gateway_id VPNGateway.new(vpn_gateway_id, :config => config) end |
#create(options = {}) ⇒ VPNGateway
Creates a new virtual private gateway. A virtual private gateway is the VPC-side endpoint for your VPN connection. You can create a virtual private gateway before creating the VPC itself.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/aws/ec2/vpn_gateway_collection.rb', line 38 def create = {} client_opts = {} client_opts[:type] = [:vpn_type] || 'ipsec.1' if az = [:availability_zone] az = az.name if az.is_a?(AvailabilityZone) client_opts[:availability_zone] = az end resp = client.create_vpn_gateway(client_opts) VPNGateway.new_from(:create_vpn_gateway, resp.vpn_gateway, resp.vpn_gateway.vpn_gateway_id, :config => config) end |