class VPC::VpnConnection

Attributes

vpn_connection_id[R]

Public Class Methods

new(config,gateway,vpn_connection_id=nil) click to toggle source
# File lib/etude_for_aws/vpc/vpn_connection.rb, line 5
def initialize(config,gateway,vpn_connection_id=nil)
  @config = config
  @gateway = gateway
  @vpn_connection_id = vpn_connection_id
end

Public Instance Methods

creat(customer_gateway_id, vpn_gateway_id, vpn_connection_info) click to toggle source
# File lib/etude_for_aws/vpc/vpn_connection.rb, line 11
def creat(customer_gateway_id, vpn_gateway_id, vpn_connection_info)
  type = vpn_connection_info['TYPE']
  static_routes_only = vpn_connection_info['OPTIONS']['STATIC_ROUTES_ONLY']
  @vpn_connection = @gateway.create_vpn_connection(type, customer_gateway_id, vpn_gateway_id, static_routes_only)
  @vpn_connection_id = @vpn_connection[0].vpn_connection_id
  resources = [@vpn_connection_id]
  vpn_connection_tags = vpn_connection_info['TAGS']
  tag = {key: vpn_connection_tags['NAME']['KEY'], value: vpn_connection_tags['NAME']['VALUE']}
  tags = [tag, @config.vpc_group_tag]
  @gateway.create_tags(resources, tags)
end
delete() click to toggle source
# File lib/etude_for_aws/vpc/vpn_connection.rb, line 23
def delete
  @gateway.delete_vpn_connection(@vpn_connection_id)
end