Amazon rallies on cloud optimism as it chases Microsoft for AI business