Infrastructure as Code, third edition (Early Release)
The third edition of the O’Reilly book Infrastructure as Code is underway, with early-release chapters available on the O’Reilly Learning Platform.
About the book
I began working as a systems administrator in the team that managed Unix servers and workstations at my university’s Computer Science department. For years afterwards, from the early dot-com days and after, I found myself drawn to finding ways to apply what I learned about software development to automate the work of managing servers and other infrastructure.
I discovered the infrastructures.org website in 2001, which was an eye opener. The authors introduced me to Mark Burgess’ pioneering infrastructure tool CFEngine and the value of automatically provisioning servers in a consistent, repeatable way, something I used to build physical servers in data centers for a series of startup and scale-up companies in the 2000’s.
Infrastructure as Code, as a term, appeared around the same time that Andrew Clay-Shafer and Patrick Debois triggered the DevOps movement with a talk at the Agile 2008 conference. The first uses I’ve found for the term “Infrastructure as Code” are from a talk called “Agile Infrastructure” that Clay-Shafer gave at the Velocity conference in 2009, and an article John Willis wrote summarizing the talk. Adam Jacob, who co-founded Chef, and Luke Kanies, founder of Puppet, were also using the phrase around this time.
Why I wrote this book
I learned how to put infrastructure as code into practice as cloud computing and infrastructure as code grew from a niche into mainstream in the 2010’s by reading blog posts, attending talks, and working with various tools with different consulting clients. I waited for one of the DevOps luminaries I admired to write a book that I could share with people as a comprehensive collection of guidance for this practice. By the middle of the decade none of them had written it, so I outlined my ideas for what they should write, carried on fleshing it out, and ended up with the first edition of this book in 2016.
The first edition focused on server configuration using tools like Chef and Puppet. The second edition in 2020 shifted to infrastructure “stacks” using tools like CDK and Terraform, with more interest in cloud-native application runtimes like container clusters and serverless.
With the third edition, the shift to using infrastructure code to provide application runtimes based on containers and serverless over configuring server images is much farther along. More people are interested in coding infrastructure using procedural languages, as enabled by CDK and Pulumi, and there is curiosity about shifting to integrating application and infrastructure code.
But although these topics are included, the emphasis of the third edition is less on different types of tools, and more on how they are used. Infrastructure architecture needs to be more focused on how it enables value for the organization. We need to start moving beyond hand-crafted infrastructure code, which has left many of us with a sprawl of snowflake environments as code. So this edition shares emerging patterns and practices for a more componentized, composable approach to infrastructure as code.
I don’t believe the journey of infrastructure management ends here. But thoughtful use of effective software design principles and techniques can help us do better, and I hope this new edition will help.
Book outline
Chapters listed in bold have a draft version available in Early Release, chapters listed in italics are still in the pipeline.
Part I: Foundations
- What Is Infrastructure as Code?
- Principles of Cloud Infrastructure
- Platforms and Toolchains
- Defining Infrastructure as Code
Part II: Design
- Design Principles For Infrastructure as Code
- Infrastructure Components
- Design Patterns for Infrastructure Deployment Stacks
- Configuring Stack Deployment Instances
- Integrating Deployment Stacks
- Infrastructure Code Libraries
- Building Servers as Code
- Designing Environments
- Applications and Infrastructure
Part III: Delivery
- Infrastructure Delivery Lifecycle
- Testing Infrastructure Code
- Infrastructure Delivery Pipelines
- Building Infrastructure Code
- Infrastructure Validation Stages
- Deploying Infrastructure
- Changing Existing Infrastructure
- Teams and Workflows