A housing complex that had been marketed to opportunistic investors as having considerable upside with the nearby arrival of Amazon's second headquarters has been acquired by a local nonprofit organization that plans to keep a majority of the units affordable for middle-income earners.