You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.
Class: AWS::EC2::RouteTable::Route
- Inherits:
-
Object
- Object
- AWS::EC2::RouteTable::Route
- Defined in:
- lib/aws/ec2/route_table/route.rb
Instance Attribute Summary collapse
-
#destination_cidr_block ⇒ String
(also: #cidr_block)
readonly
Destination_cidr_block.
-
#instance ⇒ Instance?
readonly
-
#internet_gateway ⇒ InternetGateway?
readonly
-
#network_interface ⇒ NetworkInterface?
readonly
-
#origin ⇒ Symbol
readonly
:create_route_table or :enable_vgw_route_propagation).
-
#route_table ⇒ RouteTable
readonly
-
#state ⇒ Symbol
readonly
Returns the state (:active or :blackhole).
-
#target ⇒ Gateway, ...
readonly
Returns the target of this route table.
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes this route.
-
#initialize(route_table, details) ⇒ Route
constructor
A new instance of Route.
-
#replace(options = {}) ⇒ nil
Constructor Details
#initialize(route_table, details) ⇒ Route
Returns a new instance of Route
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/aws/ec2/route_table/route.rb', line 29 def initialize route_table, details @route_table = route_table if details[:destination_cidr_block] @destination_cidr_block = details.destination_cidr_block end if details[:gateway_id] @internet_gateway = InternetGateway.new( details[:gateway_id], :config => route_table.config) end if details[:instance_id] @instance = Instance.new(details[:instance_id], :vpc_id => route_table.vpc_id, :owner_id => details[:instance_owner_id], :config => route_table.config) end if details[:network_interface_id] @network_interface = NetworkInterface.new( details[:network_interface_id], :vpc_id => route_table.vpc_id, :config => route_table.config) end @target = (internet_gateway || instance || network_interface) @origin = { 'CreateRoute' => :create_route, 'CreateRouteTable' => :create_route_table, 'EnableVgwRoutePropagation' => :enable_vgw_route_propagation }[details.origin] @state = details.state.to_sym end |
Instance Attribute Details
#destination_cidr_block ⇒ String (readonly) Also known as: cidr_block
Returns destination_cidr_block
69 70 71 |
# File 'lib/aws/ec2/route_table/route.rb', line 69 def destination_cidr_block @destination_cidr_block end |
#instance ⇒ Instance? (readonly)
77 78 79 |
# File 'lib/aws/ec2/route_table/route.rb', line 77 def instance @instance end |
#internet_gateway ⇒ InternetGateway? (readonly)
74 75 76 |
# File 'lib/aws/ec2/route_table/route.rb', line 74 def internet_gateway @internet_gateway end |
#network_interface ⇒ NetworkInterface? (readonly)
80 81 82 |
# File 'lib/aws/ec2/route_table/route.rb', line 80 def network_interface @network_interface end |
#origin ⇒ Symbol (readonly)
:create_route_table or :enable_vgw_route_propagation)
89 90 91 |
# File 'lib/aws/ec2/route_table/route.rb', line 89 def origin @origin end |
#route_table ⇒ RouteTable (readonly)
66 67 68 |
# File 'lib/aws/ec2/route_table/route.rb', line 66 def route_table @route_table end |
#state ⇒ Symbol (readonly)
Returns the state (:active or :blackhole).
92 93 94 |
# File 'lib/aws/ec2/route_table/route.rb', line 92 def state @state end |
#target ⇒ Gateway, ... (readonly)
Returns the target of this route table. It will be a gateway id, instance or a network interface.
85 86 87 |
# File 'lib/aws/ec2/route_table/route.rb', line 85 def target @target end |
Instance Method Details
#delete ⇒ nil
Deletes this route.
114 115 116 |
# File 'lib/aws/ec2/route_table/route.rb', line 114 def delete route_table.delete_route(destination_cidr_block) end |
#replace(options = {}) ⇒ nil
108 109 110 |
# File 'lib/aws/ec2/route_table/route.rb', line 108 def replace = {} route_table.replace_route(destination_cidr_block, ) end |