The website platform itself started migrating to AWS, in a crude but reasonably effective way, in 2009. Various other service owners migrated sooner though.
Also there had already long been a directive to build services as though they were going to be used by external customers since the early 2000s. It's not wrong to view AWS as just another step in Amazon's long services journey, although that elides many significant events.