/hugs-kyiv-testing-terraform

Examples for my presentation on HashiCorp user group in Kyiv on Testing Terraform Modules

Primary LanguageRuby

Examples for #2 Kyiv HashiCorp User Group meetup

This repo contains some examples for my presentation on testing terraform modules.

Prerequisites

Install ruby dependencies:

bundle install

Install terraform-plan-parser:

npm install -g terraform-plan-parser

AWS credentials should be configured link

Unit tests

Unit tests are based on terraform-plan-parser and parsing functions in ./spec/spec_helper.rb. Test specs are located in ./spec/unit/module_spec.rb

Run unit tests:

rspec --format documentation

Integration tests

Integration test use test-kitchen with kitchen-terraform plugin and awspec with kitchen-verifier-awspec plugin.
Test specs are in ./test/integration/default/instance.rb

Run integration tests:

bundle exec kitchen test

Links