Amazon will cut about 14,000 corporate jobs as the online retail giant ramps up spending on AI while trimming spending.