The 5 Rs of "as Code"

Everything old is new again

A buzzword you may have heard is "as code" -- things like Infrastructure-as-Code, Configuration-as-Code, Network-as-Code. What does it mean, and why should you care? The "as code" movement is a shift away from executing manual setup steps to writing code that will perform all the steps automatically. In a way, it's going back to the days before there were wizards and graphical user interfaces (GUIs), when doing anything meant issuing text-based commands. The wizards and GUIs simplified individual setup processes, but the steps remained essentially manual. This was fine when an organization bought new hardware or software relatively infrequently, but one of the many benefits of virtualization (whether in the cloud or on premise) is that dropping and recreating resources is pretty easy, so now setting up hardware and software is happening much more frequently. In this new paradigm, there are five benefits to converting these processes to code.

  • Reliable: When a process is written, stored, and executed as code, there is no risk of an operator accidentally skipping a step, or mistyping a command. If an error occurs, the code can be corrected once, and that error won't recur.
  • Repeatable: No matter how often the process runs, it will always do the same thing.
  • Regularized: A coded process can be designed to comply with internal or external standards and can ensure consistency of outcomes.
  • Recorded: The coded process is self-documenting, because it is documented before it happens. The documentation doesn't depend on an operator transcribing their actions.
  • Ready to Go: In what is probably the biggest benefit to practitioners, coded processes are ready to go. An operator needs simply to get the code (ideally, from a version control repository), and execute.

Though the rise of DevOps may have made it more visible, "as-code" isn’t really new. There is architecture as code, in the form of template projects and scaffolding tools that set up baseline application programming environments. Major cloud service providers (CSPs) provide infrastructure as code templates that can be used as-is or customized. Numerous software tools store configuration as code, making it much simpler to provide a consistent experience across an organization.