class AWS::EC2::RouteTable::Association
end
assoc.delete unless assoc.main?
assoc = subnet.route_table_association
vpc.subnets.each do |subnet|
# all subnets will default to the main route table
# delete all explicit route table associations – as a result
main route table.
delete an association, the subnet becomes associated with the
You can delete all but the main route table association. When you
## Deleting an Association
then that association will be repalced.
If it was previously associated directly to a different route table
table via the main (default) association a new association is created.
If this route table is associated (by default) to the main route
subnet.route_table = some_other_route_table
To replace a route table association start at the subnet end:
## Creating and Replacing a Route Table Association
subnet.route_table_association.main? #=> true/false
subnet.route_table_association #=> AWS::EC2::RouteTable::Association
with the main route table.
was never explicitly created, then they are associated by default
All subnets are associated with a route table. If the association
## Getting a Subnet Route Table Association
end
end
puts “#{assoc.id} : #{assoc.subnet.id}”
else
puts “#{assoc.id} : main association”
if assoc.main? # main association does not have a subnet
route_table.associations.each do |assoc|
Given a route table:
## Enumerating Associations
* Asking a subnet for its route table association
* enumerating associations from a route table
You can get a route table association 2 ways:
Represents the association between a {RouteTable} and a {Subnet}.
def delete
-
(nil)
-
def delete route_table.client.disassociate_route_table( :association_id => association_id) nil end
def initialize route_table, association_id, subnet_id
- Api: - private
def initialize route_table, association_id, subnet_id @route_table = route_table @association_id = association_id if subnet_id @main = false @subnet = Subnet.new(subnet_id, :config => route_table.config) else @main = true end end