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

        client_opts = {}

        [:instance,:network_interface,:private_ip_address].each do |opt|
          if value = options[opt]
                key = ( opt.to_s=='instance' || opt.to_s=='network_interface' ? opt.to_s+"_id" : opt.to_s ) 
                client_opts["#{key}""#{key}"] = 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