A major Amazon Web Services outage threw much of the internet into disarray on Monday as popular websites and social-media platforms struggled to recover.