"...But can apple dictate licensing terms like this? If aws buys a mac, can't they use it however they like? Or are there terms limiting this in the purchase agreement..."
Yes, no, and yes.
Yes, no, and yes.
Apple can't practically enforce that against you, an individual using a mac in your home. But then again you're probably not reselling your mac's functionality directly for profit to others. They for sure can seek to enforce it with AWS or others who sell it commercially. It's the reselling of their software and functionality for profit that is covered by the terms of the agreement.