Amazon.com Inc.’s cloud unit will spend $35 billion on new data centers in Virginia by 2040, underscoring its determination to stay ahead of rivals Microsoft Corp. and Alphabet Inc.