class VPC::RouteTable

Attributes

associate_route_table_ids[R]
route_table_id[R]

Public Class Methods

new() click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 6
def initialize
  @associate_route_table_ids = []
end

Public Instance Methods

associate_route_table(vpc,route_table_id,subnet_id) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 31
def associate_route_table(vpc,route_table_id,subnet_id)
  @associate_route_table_ids << vpc.gateway.associate_route_table(route_table_id,subnet_id)
end
create(vpc) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 15
def create(vpc)
  @route_table_id = vpc.gateway.create_route_table(vpc.vpc_id)
end
create_private_route(vpc) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 19
def create_private_route(vpc)
  vpc.gateway.create_route_private(@route_table_id)
end
create_public_route(vpc,destination_cidr_block,internet_gateway_id) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 23
def create_public_route(vpc,destination_cidr_block,internet_gateway_id)
  vpc.gateway.create_route_public(destination_cidr_block,internet_gateway_id,@route_table_id)
end
create_vpn_route(vpc,destination_cidr_block,vpn_gateway_id) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 27
def create_vpn_route(vpc,destination_cidr_block,vpn_gateway_id)
  vpc.gateway.create_route_vpn(destination_cidr_block,vpn_gateway_id,@route_table_id)
end
delete(vpc) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 35
def delete(vpc)
  @associate_route_table_ids.each do |id|
    vpc.gateway.disassociate_route_table(id)
  end
  vpc.gateway.delete_route_table(route_table_id)
end
setup(id,vpc) click to toggle source
# File lib/etude_for_aws/vpc/route_table.rb, line 10
def setup(id,vpc)
  @route_table_id = id
  @associate_route_table_ids = vpc.gateway.select_associate_route_table_ids_by_route_table_id(@route_table_id)
end