Class: CfRoute

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/vpc/cf_route.rb

Instance Method Summary collapse

Methods included from CfBase

#generate, #generate_ref, #get_deletion_policy, #get_name, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name, dest_cidr, gateway = nil, instance = nil, eni = nil) ⇒ CfRoute

Returns a new instance of CfRoute.



6
7
8
9
10
11
12
# File 'lib/cf_factory/vpc/cf_route.rb', line 6

def initialize(name, dest_cidr, gateway = nil, instance = nil, eni = nil)
  @name = name
  @dest_cidr = dest_cidr  
  @gateway  = gateway
  @instance = instance
  @eni = eni
end

Instance Method Details

#add_associationObject



18
19
# File 'lib/cf_factory/vpc/cf_route.rb', line 18

def add_association()
end

#get_cf_attributesObject



25
26
27
# File 'lib/cf_factory/vpc/cf_route.rb', line 25

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/cf_factory/vpc/cf_route.rb', line 29

def get_cf_properties
  options = {}
  unless @gateway.nil?
    options["GatewayId"] = @gateway.generate_ref
  end
  unless @instance.nil?
    options["InstanceId"] = @instance.generate_ref
  end
  unless @eni.nil?
    options["NetworkInterfaceId"] = @eni.generate_ref
  end
  {"RouteTableId" => @route_table.generate_ref, "DestinationCidrBlock" => @dest_cidr}.merge(options)
end

#get_cf_typeObject



21
22
23
# File 'lib/cf_factory/vpc/cf_route.rb', line 21

def get_cf_type
  "AWS::EC2::Route"
end

#set_route_table(route_table) ⇒ Object



14
15
16
# File 'lib/cf_factory/vpc/cf_route.rb', line 14

def set_route_table(route_table)
  @route_table = route_table
end