EC2 was, in some capacity, a tech borrowed from the Alexa (analytics) acquisition, which teams in Cape Town built upon.
SimpleDB (worked upon since 2005, and managed by people acquihired from Junglee.com), morphed into DynamoDB (started 2009-11) pretty immediately as they realised that it was going to be no where near enough.
Bezos personally pursued Werner Vogels to lead the web services initiative sometime in 2003. A lot of folks from the Retail Org, who solved problems of enormous complexities for Amazon.com, the website, got together to create AWS.
[0] Side note: Amazon's top hierarchy meets once every year and decides to invest in two new buinesses Amazon has never been involved in, or markets it can transform due to its involvement in multiple sectors... that's why there's so much happening at any given point in time at Amazon. It's really an incredible place if innovation is what drives you.