Find a RouteTable for a given public Subnet:
subnet = Fog::Compute["aws"].subnets.last
subnet_id = subnet.subnet_id
rts = Fog::Compute["aws"].route_tables
route_table_for_subnet = rts.find {|rt| rt.associations.find {|assoc| assoc["subnetId"] == subnet_id} }
If route_table_for_subnet
is nil then the subnet is private.
Or run the vpc_subnets.rb
script:
$ ruby subnets.rb
subnet-825d74d4: private
subnet-835d74d5: public