Automated Synthesis of Resilient Architectures