Infrastructure as Code (IAC) Cookbook

Over 90 practical, actionable recipes to automate, test, and manage your infrastructure quickly and effectively
Preview in Mapt

Infrastructure as Code (IAC) Cookbook

Stephane Jourdan, Pierre Pomes

1 customer reviews
Over 90 practical, actionable recipes to automate, test, and manage your infrastructure quickly and effectively

Quick links: > What will you learn?> Table of content> Product reviews

Mapt Subscription
FREE
$29.99/m after trial
eBook
$20.00
RRP $39.99
Save 49%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$20.00
$49.99
$29.99 p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Infrastructure as Code (IAC) Cookbook Book Cover
Infrastructure as Code (IAC) Cookbook
$ 39.99
$ 20.00
Getting Started with Terraform Book Cover
Getting Started with Terraform
$ 31.99
$ 16.00
Buy 2 for $33.50
Save $38.48
Add to Cart

Book Details

ISBN 139781786464910
Paperback440 pages

Book Description

Infrastructure as Code (IAC) is a key aspect of the DevOps movement, and this book will show you how to transform the way you work with your infrastructure—by treating it as software.

This book is dedicated to helping you discover the essentials of infrastructure automation and its related practices; the over 90 organized practical solutions will demonstrate how to work with some of the very best tools and cloud solutions.

You will learn how to deploy repeatable infrastructures and services on AWS, OpenStack, Google Cloud, and Digital Ocean. You will see both Ansible and Terraform in action, manipulate the best bits from cloud-init to easily bootstrap instances, and simulate consistent environments locally or remotely using Vagrant. You will discover how to automate and test a range of system tasks using Chef or Puppet. You will also build, test, and debug various Docker containers having developers’ interests in mind.

This book will help you to use the right tools, techniques, and approaches to deliver working solutions for today’s modern infrastructure challenges.

Table of Contents

Chapter 1: Vagrant Development Environments
Introduction
Adding an Ubuntu Xenial (16.04 LTS) Vagrant box
Using a disposable Ubuntu Xenial (16.04) in seconds
Enabling VirtualBox Guest Additions in Vagrant
Using a disposable CentOS 7.x with VMware in seconds
Extending the VMware VM capabilities
Enabling multiprovider Vagrant environments
Customizing a Vagrant VM
Using Docker with Vagrant
Using Docker in Vagrant for a Ghost blog behind NGINX
Using Vagrant remotely with AWS EC2 and Docker
Simulating dynamic multiple host networking
Simulating a networked three-tier architecture app with Vagrant
Showing your work on the LAN while working with Laravel
Sharing access to your Vagrant environment with the world
Simulating Chef upgrades using Vagrant
Using Ansible with Vagrant to create a Docker host
Using Docker containers on CoreOS with Vagrant
Chapter 2: Provisioning IaaS with Terraform
Introduction
Configuring the Terraform AWS provider
Creating and using an SSH key pair to use on AWS
Using AWS security groups with Terraform
Creating an Ubuntu EC2 instance with Terraform
Generating meaningful outputs with Terraform
Using contextual defaults with Terraform
Managing S3 storage with Terraform
Creating private Docker repositories with Terraform
Creating a PostgreSQL RDS database with Terraform
Enabling CloudWatch Logs for Docker with Terraform
Managing IAM users with Terraform
Chapter 3: Going Further with Terraform
Introduction
Handling different environments with Terraform
Provisioning a CentOS 7 EC2 instance with Chef using Terraform
Using data sources, templates, and local execution
Executing remote commands at bootstrap using Terraform
Using Docker with Terraform
Simulating infrastructure changes using Terraform
Teamwork – sharing Terraform infrastructure state
Maintaining a clean and standardized Terraform code
One Makefile to rule them all
Team workflow example
Managing GitHub with Terraform
External monitoring integration with StatusCake
Chapter 4: Automating Complete Infrastructures with Terraform
Introduction
Provisioning a complete CoreOS infrastructure on Digital Ocean with Terraform
Provisioning a three-tier infrastructure on Google Compute Engine
Provisioning a GitLab CE + CI runners on OpenStack
Managing Heroku apps and add-ons using Terraform
Creating a scalable Docker Swarm cluster on bare metal with Packet
Chapter 5: Provisioning the Last Mile with Cloud-Init
Introduction
Using cloud-init on AWS, Digital Ocean, or OpenStack
Handling files using cloud-init
Configuring the server's time zone using cloud-init
Managing users, keys, and credentials using cloud-init
Managing repositories and packages using cloud-init
Running commands during boot using cloud-init
Configuring CoreOS using cloud-init
Deploying Chef Client from start to finish using cloud-init
Deploying a remote Docker server using cloud-init
Chapter 6: Fundamentals of Managing Servers with Chef and Puppet
Introduction
Getting started (notions and tools)
Installing the Chef Development kit and Puppet Collections
Creating a free hosted server Chef account and a Puppet server
Automatically bootstrapping a Chef client and a Puppet agent
Installing packages
Managing services
Managing files, directories, and templates
Handling dependencies
More dynamic code using notifications
Centrally sharing data using a Chef data bag and Hiera with Puppet
Creating functional roles
Managing external Chef cookbooks and Puppet modules
Chapter 7: Testing and Writing Better Infrastructure Code with Chef and Puppet
Introduction
Linting Chef code with Foodcritic and Puppet code with puppet-lint
Unit testing with ChefSpec and rspec-puppet
Testing infrastructure with Test Kitchen for Chef and Beaker for Puppet
Integration testing with ServerSpec
Chapter 8: Maintaining Systems Using Chef and Puppet
Introduction
Maintaining consistent systems using scheduled convergence
Creating environments
Using Chef encrypted data bags and Hiera-eyaml with Puppet
Using Chef Vault encryption
Accessing and manipulating system information with Ohai
Automating application deployment (a WordPress example)
Using a TDD workflow
Planning for the worse – train to rebuild working systems
Chapter 9: Working with Docker
Introduction
Docker usage overview
Choosing the right Docker base image
Optimizing the Docker image size
Versioning Docker images with tags
Deploying a Ruby-on-Rails web application in Docker
Building and using Golang applications with Docker
Networking with Docker
Creating more dynamic containers
Auto-configuring dynamic containers
Better security with unprivileged users
Orchestrating with Docker Compose
Linting a Dockerfile
Deploying a private Docker registry with S3 storage
Chapter 10: Maintaining Docker Containers
Introduction
Testing Docker containers with BATS
Test-Driven Development (TDD) with Docker and ServerSpec
The workflow for creating automated Docker builds from Git
The workflow for connecting the Continuous Integration (CI) system
Scanning for vulnerabilities with Quay.io and Docker Cloud
Sending Docker logs to AWS CloudWatch logs
Monitoring and getting information out of Docker
Debugging containers using sysdig

What You Will Learn

  • Provision local and remote development environments with Vagrant
  • Automate production infrastructures with Terraform, Ansible and Cloud-init on AWS, OpenStack, Google Cloud, Digital Ocean, and more
  • Manage and test automated systems using Chef and Puppet
  • Build, ship, and debug optimized Docker containers
  • Explore the best practices to automate and test everything from cloud infrastructures to operating system configuration

Authors

Table of Contents

Chapter 1: Vagrant Development Environments
Introduction
Adding an Ubuntu Xenial (16.04 LTS) Vagrant box
Using a disposable Ubuntu Xenial (16.04) in seconds
Enabling VirtualBox Guest Additions in Vagrant
Using a disposable CentOS 7.x with VMware in seconds
Extending the VMware VM capabilities
Enabling multiprovider Vagrant environments
Customizing a Vagrant VM
Using Docker with Vagrant
Using Docker in Vagrant for a Ghost blog behind NGINX
Using Vagrant remotely with AWS EC2 and Docker
Simulating dynamic multiple host networking
Simulating a networked three-tier architecture app with Vagrant
Showing your work on the LAN while working with Laravel
Sharing access to your Vagrant environment with the world
Simulating Chef upgrades using Vagrant
Using Ansible with Vagrant to create a Docker host
Using Docker containers on CoreOS with Vagrant
Chapter 2: Provisioning IaaS with Terraform
Introduction
Configuring the Terraform AWS provider
Creating and using an SSH key pair to use on AWS
Using AWS security groups with Terraform
Creating an Ubuntu EC2 instance with Terraform
Generating meaningful outputs with Terraform
Using contextual defaults with Terraform
Managing S3 storage with Terraform
Creating private Docker repositories with Terraform
Creating a PostgreSQL RDS database with Terraform
Enabling CloudWatch Logs for Docker with Terraform
Managing IAM users with Terraform
Chapter 3: Going Further with Terraform
Introduction
Handling different environments with Terraform
Provisioning a CentOS 7 EC2 instance with Chef using Terraform
Using data sources, templates, and local execution
Executing remote commands at bootstrap using Terraform
Using Docker with Terraform
Simulating infrastructure changes using Terraform
Teamwork – sharing Terraform infrastructure state
Maintaining a clean and standardized Terraform code
One Makefile to rule them all
Team workflow example
Managing GitHub with Terraform
External monitoring integration with StatusCake
Chapter 4: Automating Complete Infrastructures with Terraform
Introduction
Provisioning a complete CoreOS infrastructure on Digital Ocean with Terraform
Provisioning a three-tier infrastructure on Google Compute Engine
Provisioning a GitLab CE + CI runners on OpenStack
Managing Heroku apps and add-ons using Terraform
Creating a scalable Docker Swarm cluster on bare metal with Packet
Chapter 5: Provisioning the Last Mile with Cloud-Init
Introduction
Using cloud-init on AWS, Digital Ocean, or OpenStack
Handling files using cloud-init
Configuring the server's time zone using cloud-init
Managing users, keys, and credentials using cloud-init
Managing repositories and packages using cloud-init
Running commands during boot using cloud-init
Configuring CoreOS using cloud-init
Deploying Chef Client from start to finish using cloud-init
Deploying a remote Docker server using cloud-init
Chapter 6: Fundamentals of Managing Servers with Chef and Puppet
Introduction
Getting started (notions and tools)
Installing the Chef Development kit and Puppet Collections
Creating a free hosted server Chef account and a Puppet server
Automatically bootstrapping a Chef client and a Puppet agent
Installing packages
Managing services
Managing files, directories, and templates
Handling dependencies
More dynamic code using notifications
Centrally sharing data using a Chef data bag and Hiera with Puppet
Creating functional roles
Managing external Chef cookbooks and Puppet modules
Chapter 7: Testing and Writing Better Infrastructure Code with Chef and Puppet
Introduction
Linting Chef code with Foodcritic and Puppet code with puppet-lint
Unit testing with ChefSpec and rspec-puppet
Testing infrastructure with Test Kitchen for Chef and Beaker for Puppet
Integration testing with ServerSpec
Chapter 8: Maintaining Systems Using Chef and Puppet
Introduction
Maintaining consistent systems using scheduled convergence
Creating environments
Using Chef encrypted data bags and Hiera-eyaml with Puppet
Using Chef Vault encryption
Accessing and manipulating system information with Ohai
Automating application deployment (a WordPress example)
Using a TDD workflow
Planning for the worse – train to rebuild working systems
Chapter 9: Working with Docker
Introduction
Docker usage overview
Choosing the right Docker base image
Optimizing the Docker image size
Versioning Docker images with tags
Deploying a Ruby-on-Rails web application in Docker
Building and using Golang applications with Docker
Networking with Docker
Creating more dynamic containers
Auto-configuring dynamic containers
Better security with unprivileged users
Orchestrating with Docker Compose
Linting a Dockerfile
Deploying a private Docker registry with S3 storage
Chapter 10: Maintaining Docker Containers
Introduction
Testing Docker containers with BATS
Test-Driven Development (TDD) with Docker and ServerSpec
The workflow for creating automated Docker builds from Git
The workflow for connecting the Continuous Integration (CI) system
Scanning for vulnerabilities with Quay.io and Docker Cloud
Sending Docker logs to AWS CloudWatch logs
Monitoring and getting information out of Docker
Debugging containers using sysdig

Book Details

ISBN 139781786464910
Paperback440 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Getting Started with Terraform Book Cover
Getting Started with Terraform
$ 31.99
$ 16.00
Learning DevOps: Continuously Deliver Better Software Book Cover
Learning DevOps: Continuously Deliver Better Software
$ 67.99
$ 34.00
AWS Administration Cookbook Book Cover
AWS Administration Cookbook
$ 35.99
$ 18.00
Microservices Deployment Cookbook Book Cover
Microservices Deployment Cookbook
$ 39.99
$ 20.00
Mastering Docker Book Cover
Mastering Docker
$ 39.99
$ 20.00
Native Docker Clustering with Swarm Book Cover
Native Docker Clustering with Swarm
$ 35.99
$ 18.00