Associate an EIP with a given instance or network interface. If
        the EIP was allocated for a VPC instance, an AllocationId(aid) must
        be provided instead of a PublicIp.

def associate(self, eip_or_aid,
                  instance_id='', network_interface_id='', private_ip=''):
        """Associate an EIP with a given instance or network interface. If
        the EIP was allocated for a VPC instance, an AllocationId(aid) must
        be provided instead of a PublicIp.
        """
        if "." in eip_or_aid:               # If an IP is given (Classic)
            return self.call("AssociateAddress",
                             PublicIp=eip_or_aid,
                             InstanceId=instance_id,
                             NetworkInterfaceId=network_interface_id,
                             PrivateIpAddress=private_ip)
        else:                               # If an AID is given (VPC)
            return self.call("AssociateAddress",
                             AllocationId=eip_or_aid,
                             InstanceId=instance_id,
                             NetworkInterfaceId=network_interface_id,
                             PrivateIpAddress=private_ip)