Infrastructure as Code - WikipediaInfrastructure as Code (IaC) is the process of managing and provisioning computing infrastructure (processes, bare-metal servers, virtual servers, etc.) and their configuration through machine-processable definition files, rather than physical hardware configuration or the use of interactive configuration tools. The definition files may be in a version control system. This has been achieved previously through either scripts or declarative definitions, rather than manual processes, but developments as specifically titled 'IaC' are now focused on the declarative approaches.
Infrastructure as Code approaches have become increasingly widespread with the adoption of cloud computing, which is sometimes marketed as "infrastructure as a service" (IaaS). IaC supports IaaS, but should not be confused with it.
IaC grew as a response to the difficulty posed from two pieces of disruptive technology – utility computing and the second-generation web frameworks. This brought about widespread scaling problems for many enterprises that were previously only witnessed by huge companies.
In 2006 specifically, new challenges were brought to the forefront that shook the technology industry; the launch of Amazon Web Services’ Elastic Compute Cloud and the 1.0 version of Ruby on Rails just months before. With new tools emerging to handle this ever growing field, the idea of Infrastructure as Code was born.
The thought of modelling infrastructure with code, and then having the ability to design, implement, and deploy applications infrastructure with known software best practices appealed to software developers and IT infrastructure administrators. The ability to treat it like code and use the same tools as any other software project would allow developers to rapidly deploy applications.
The value of Infrastructure as Code can be broken down into three, measurable categories:
Cost reduction aims at helping not only the enterprise financially but also in terms of people and effort, meaning that by removing the manual component, people are able to refocus their efforts towards other enterprise tasks. Infrastructure automation enables speed through faster execution when configuring your infrastructure and aims at providing visibility to help other teams across the enterprise work quickly and more efficiently. Automation removes the risk associated with human error, like manual misconfiguration; removing this can decrease downtime and increase reliability.
These outcomes and attributes help the enterprise move towards implementing a culture of DevOps, the combined working of Development and Operations.
There are generally three approaches to IaC: declarative (functional) vs. imperative (procedural) vs. intelligent (environment aware). The difference between the declarative, the imperative and the intelligent approach is essentially 'what' versus 'how' versus 'why' . The declarative approach focuses on what the eventual target configuration should be; the imperative focuses on how the infrastructure is to be changed to meet this; the intelligent approach focuses on why the configuration should be a certain way in consideration of all the co-relationships and co-dependencies of multiple applications running on the same infrastructure typically found in production. The declarative approach defines the desired state and the system executes what needs to happen to achieve that desired state. Imperative defines specific commands that need to be executed in the appropriate order to end with the desired conclusion. The intelligent determines the correct desired state before the system executes what needs to happen to achieve a desired state that does not impact co-dependent applications. Environment aware desired state is the next generation of IaC.
There are two methods of IaC: 'Push' and 'Pull' . The main difference is the manner in which the servers are told how to be configured. In the Pull method the server to be configured will pull its configuration from the controlling server. In the Push method the controlling server pushes the configuration to the destination system.
There are many tools that fulfill infrastructure automation capabilities and utilize Infrastructure as Code. Broadly speaking, any framework, or tool that performs changes or configures infrastructure declaratively or imperatively based on a programmatic approach can be considered IaC. Traditionally, server (lifecycle) automation and configuration management tools were used to accomplish IaC, now enterprises are utilizing Continuous Configuration Automation tools or stand-alone IaC frameworks, such as Microsoft’s PowerShell DSC.
All Continuous Configuration Automation (CCA) tools can be thought of as an extension of traditional IaC frameworks; it leverages IaC to change, configure, and automate infrastructure, but also provides visibility, efficiency and flexibility in how your infrastructure is managed. These additional attributes provide enterprise level security and compliance - making companies keen on implementing these types of tools.
An important aspect when considering CCA tools, if they are open source, is the community content. As Gartner states the value of CCA tools is “as dependent on user community-contributed content and support as it is on the commercial maturity and performance of the automation tooling.” Vendors like Puppet and Chef, those that have been around a significant amount of time, have created their own communities; Chef has Chef Community Repository and Puppet has PuppetForge, other vendors rely on adjacent communities and leverage other IaC frameworks such as PowerShell DSC. New vendors are emerging that are not content driven, but model driven with the intelligence in the product to deliver content. These visual, object oriented systems work well for developers, but are especially useful to production oriented DevOps and Ops constituents that value models verses scripting for content. As the field continues to develop and change, the community based content will become ever important to how IaC tools are utilized, unless they are model driven and object oriented.
Notable CCA tools include:
|Declarative & Imperative
|Declarative & Imperative
|Push and Pull
|Declarative & Imperative
Infrastructure as Code can be a key attribute of enabling best practices in DevOps – Developers become more involved in defining configuration and Ops teams get involved earlier in the development process. Tools that utilize IaC bring visibility to the state and configuration of servers and ultimately provide the visibility to users within the enterprise, aiming to bring teams together to maximize their efforts. Automation in general aims to take the confusion and error-prone aspect of manual processes and make it more efficient, and productive. Allowing for better software and applications to be created with flexibility, less downtime, and an overall cost effective way for the company. IaC is intended to reduce the complexity that kills efficiency out of manual configuration. Automation and collaboration are considered central points in DevOps; Infrastructure automation tools are often included as components of a DevOps toolchain.