# File lib/fog/aws/requests/compute/associate_address.rb, line 25
        def associate_address(*args)
          if args.first.kind_of? Hash
            params = args.first
          else
            params = {
                :instance_id => args[0],
                :public_ip => args[1],
                :network_interface_id => args[2],
                :allocation_id => args[3],
                :private_ip_address => args[4],
                :allow_reassociation => args[5],
            }
          end
          # Cannot specify an allocation ip and a public IP at the same time.  If you have an allocation Id presumably you are in a VPC
          # so we will null out the public IP
          params[:public_ip] = params[:allocation_id].nil? ? params[:public_ip] : nil

          request(
            'Action'             => 'AssociateAddress',
            'AllocationId'       => params[:allocation_id],
            'InstanceId'         => params[:instance_id],
            'NetworkInterfaceId' => params[:network_interface_id],
            'PublicIp'           => params[:public_ip],
            'PrivateIpAddress'   => params[:private_ip_address],
            'AllowReassociation' => params[:allow_reassociation],
            :idempotent          => true,
            :parser              => Fog::Parsers::Compute::AWS::AssociateAddress.new
          )
        end