6 Testing

This chapter covers

  • Identifying which type of tests to write for infrastructure systems
  • Writing tests to verify infrastructure configuration or modules
  • Understanding the cost of various types of tests

Recall from chapter 1 that infrastructure as code involves an entire process to push a change to a system. You update scripts or configurations with infrastructure changes, push them to a version control system, and apply the changes in an automated way. However, you can use every module and dependency pattern from chapters 3 and 4 and still have failed changes! How do you catch a failed change before you apply it to production?

You can solve this problem by implementing tests for IaC. Testing is a process that evaluates whether a system ...

Get Infrastructure as Code, Patterns and Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.