Class: AWS::EC2::RouteTableCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::RouteTableCollection
- Includes:
- Core::Collection::Simple, TaggedCollection
- Defined in:
- lib/aws/ec2/route_table_collection.rb
Instance Attribute Summary
Attributes included from Core::Model
Instance Method Summary collapse
- #[](route_table_id) ⇒ RouteTable
-
#create(options = {}) ⇒ RouteTable
Creates a route table.
-
#main_route_table ⇒ RouteTable
Returns the main (default) route table.
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
#[](route_table_id) ⇒ RouteTable
45 46 47 |
# File 'lib/aws/ec2/route_table_collection.rb', line 45 def [] route_table_id RouteTable.new(route_table_id, :config => config) end |
#create(options = {}) ⇒ RouteTable
Creates a route table.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/aws/ec2/route_table_collection.rb', line 31 def create = {} client_opts = {} client_opts[:vpc_id] = vpc_id_option() resp = client.create_route_table(client_opts) RouteTable.new_from(:create_route_table, resp.route_table, resp.route_table.route_table_id, :config => config) end |
#main_route_table ⇒ RouteTable
Returns the main (default) route table. This route table is automatically assigned to new subnets and can not be deleted.
52 53 54 55 |
# File 'lib/aws/ec2/route_table_collection.rb', line 52 def main_route_table @main = AWS.memoize { self.find {|rt| rt.main? } } if @main.nil? @main end |