O'Reilly logo

Getting Started with Terraform by Kirill Shirinkin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing servers with Inspec

Just as your application, code should be covered with unit and integration tests. Infrastructure as Code should have good test coverage as well. There are multiple ways to do infrastructure code tests. They are as follows:

  • Test only the code, without creating a real infrastructure (with tools such as ChefSpec and rspec-puppet)
  • Test a single server
  • Test the complete system

We won't look at the first option to test our infrastructure in this book. For guidance on how to test the complete system (with all the cloud resources, servers, and so on), look at Chapter 7, Collaborative Infrastructure. As for this chapter, let's check one way to test a single server with Terraform and Inspec.

Inspec is a testing framework, written ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required