# File lib/aws/ec2/subnet.rb, line 100
      def set_route_table route_table

        unless route_table.is_a?(RouteTable)
          route_table = RouteTable.new(route_table, :config => config)
        end

        client_opts = {}
        client_opts[:route_table_id] = route_table.id

        assoc = route_table_association

        if assoc.main?
          client_opts[:subnet_id] = subnet_id
          response = client.associate_route_table(client_opts)
          association_id = response.association_id
        else
          client_opts[:association_id] = assoc.association_id
          resp = client.replace_route_table_association(client_opts)
          association_id = resp.new_association_id
        end

        RouteTable::Association.new(route_table, association_id, subnet_id)

      end