# File lib/aws/ec2/elastic_ip.rb, line 132
      def associate options

        client_opts = {}

        [:instance,:network_interface].each do |opt|
          if value = options[opt]
            client_opts["#{opt}_id""#{opt}_id"] = value.is_a?(Resource) ? value.id : value
          end
        end

        if vpc?
          client_opts[:allocation_id] = allocation_id
        else
          client_opts[:public_ip] = public_ip
        end

        resp = client.associate_address(client_opts)
        resp.data[:association_id]

      end