Infrastructure as code explained

Infrastructure as code (IaC) is the process of managing and provisioning computer data center resources through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.The IT infrastructure managed by this process comprises both physical equipment, such as bare-metal servers, as well as virtual machines, and associated configuration resources.The definitions may be in a version control system, rather than maintaining the code through manual processes.The code in the definition files may use either scripts or declarative definitions, but IaC more often employs declarative approaches.

Overview

IaC grew as a response to the difficulty posed by utility computing and second-generation web frameworks. In 2006, the launch of Amazon Web ServicesElastic Compute Cloud and the 1.0 version of Ruby on Rails just months before[1] created widespread scaling difficulties in the enterprise that were previously experienced only at large, multi-national companies.[2] With new tools emerging to handle this ever-growing field, the idea of IaC was born. The thought of modeling infrastructure with code, and then having the ability to design, implement, and deploy application infrastructure with known software best practices appealed to both software developers and IT infrastructure administrators. The ability to treat infrastructure as code and use the same tools as any other software project would allow developers to rapidly deploy applications.[3]

Advantages

The value of IaC can be broken down into three measurable categories: cost, speed, and risk. 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 on 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.[4]

Types of approaches

There are generally two approaches to IaC: declarative (functional) vs. imperative (procedural). The difference between the declarative and the imperative approach is essentially 'what' versus 'how' . 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.[5] 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.[6]

Methods

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.[7]

Tools

There are many tools that fulfill infrastructure automation capabilities and use IaC. Broadly speaking, any framework or tool that performs changes or configures infrastructure declaratively or imperatively based on a programmatic approach can be considered IaC.[8] Traditionally, server (lifecycle) automation and configuration management tools were used to accomplish IaC. Now enterprises are also using continuous configuration automation tools or stand-alone IaC frameworks, such as Microsoft’s PowerShell DSC[9] or AWS CloudFormation.[10]

Continuous configuration automation

All continuous configuration automation (CCA) tools can be thought of as an extension of traditional IaC frameworks. They leverage IaC to change, configure, and automate infrastructure, and they also provide visibility, efficiency and flexibility in how infrastructure is managed.[2] These additional attributes provide enterprise-level security and compliance.

Community content

See also: List of systems management systems and Comparison of open-source configuration management software. Community content is a key determinant of the quality of an open source CCA tool. 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". Established vendors such as Puppet and Chef have created their own communities. Chef has Chef Community Repository and Puppet has PuppetForge.[11] Other vendors rely on adjacent communities and leverage other IaC frameworks such as PowerShell DSC.[9] 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 they are especially useful to production-oriented DevOps and operations constituents that value models versus scripting for content. As the field continues to develop and change, the community-based content will become ever more important to how IaC tools are used, unless they are model-driven and object-oriented.

Notable CCA tools include:

Tool Released by Method Approach Written in Comments
CFEngineNorthern.tech (1993)PullDeclarativeC-
PuppetPuppet (2005)Push and PullDeclarative and imperativeC++ & Clojure since 4.0, Ruby-
ChefChef (2009)PullDeclarative and imperativeRuby-
SaltStackSaltStack (2011)Push and PullDeclarative and imperativePython-
Ansible / Ansible TowerRed Hat (2012)Push and PullDeclarative and imperativePython-
TerraformHashiCorp (2014)PushDeclarative and imperativeGo-
OtterInedo (2015)PushDeclarative and imperative-Windows-oriented
PulumiPulumi (2018)PushDeclarative and imperativeGo

Other tools include AWS CloudFormation, cdist, StackStorm, Juju, and Step CI.

Relationships

Relationship to DevOps

IaC 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.[12] 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.[13] 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.[14]

Relationship to security

The 2020 Cloud Threat Report released by Unit 42 (the threat intelligence unit of cybersecurity provider Palo Alto Networks) identified around 200,000 potential vulnerabilities in infrastructure as code templates.[15]

See also

Notes and References

  1. Bower . Joseph L. . Christensen . Clayton M. . Disruptive Technologies: Catching the Wave . Harvard Business Review.
  2. Fletcher . Colin . Cosgrove . Terrence . Innovation Insight for Continuous Configuration Automation Tools . Gartner . 26 August 2015.
  3. Riley. Chris. 12 November 2015 . Version Your Infrastructure . DevOps.com.
  4. Web site: Moving from Infrastructure Automation to True DevOps . Phillips . Andrew . DevOps.com . 14 May 2015.
  5. Web site: Declarative v. Imperative Models for Configuration Management: Which Is Really Better? . Scriptrock.com . 14 December 2015 . 31 March 2015 . https://web.archive.org/web/20150331062438/https://www.scriptrock.com/blog/articles/declarative-vs.-imperative-models-for-configuration-management . dead .
  6. Loschwitz . Martin . 14 November 2014 . Choosing between the leading open source configuration managers . Admin Network & Security . Lawrence, KS USA . Linux New Media USA LLC.
  7. Web site: Puppet vs. Chef vs. Ansible vs. Salt . Venezia . Paul . 21 November 2013 . . Network World . 14 December 2015 . 18 July 2018 . https://web.archive.org/web/20180718030604/https://www.networkworld.com/article/2172097/virtualization/puppet-vs--chef-vs--ansible-vs--salt.html . dead .
  8. Garner Market Trends: DevOps – Not a Market, but Tool-Centric Philosophy That supports a Continuous Delivery Value Chain . Gartner . 18 February 2015.
  9. Chaganti. Ravikanth . 5 January 2016 . DevOps, Infrastructure as Code, and PowerShell DSC: The Introduction . PowerShell Magazine . PowerShell Magazine . 11 January 2016 .
  10. Web site: Introducing AWS CloudFormation.
  11. Web site: Puppet or Chef? . Sturgeon . Phil . 28 October 2012.
  12. Web site: Continuous Integration: Infrastructure as Code in DevOps . Ramos . Martin . easydynamics.com . 4 November 2015 . 29 January 2016 . https://web.archive.org/web/20160206165308/http://info.easydynamics.com/blog/continuous-integration-infrastructure-as-code . 6 February 2016 . dead .
  13. Infrastructure As Code: Fueling the Fire for Faster Application Delivery . Forrester . March 2015.
  14. Wurster . Laurie F. . Colville . Ronni J. . Height. Cameron . Tripathi . Somendra . Rastogi . Aditi . Emerging Technology Analysis: DevOps a Culture Shift, Not a Technology. Gartner .
  15. Web site: Cloud Threat Report Shows Need for Consistent DevSecOps. InformationWeek. 13 February 2020. en. 2020-02-24.