If you&#x27;re writing your own, you might also look to BOSH[1] for inspiration.<p>It&#x27;s older than CloudFormation and Terraform (born 2010). It can manage anything that someone&#x27;s written a driver for. So far that includes AWS, Azure, vSphere&#x2F;vCloud, OpenStack, VirtualBox, Google Compute Engine, Apache CloudStack and there might be others I missed.<p>It stores state in a database. It is able to recover from mismatches between the state of the world and the desired state. Cloud Foundry users have been using it for years to deploy and update CF installations. Pivotal Web Services (I work for Pivotal, in a different division) has been upgrading to the most recent CF release every few weeks, live, without much fuss, for years.<p>For any kind of heavily stateful infrastructure, BOSH is a strong candidate.<p>[1] <a href="https:&#x2F;&#x2F;bosh.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bosh.io&#x2F;</a>