Amazon posts record $2.5bn profit fueled by ad and cloud businesses