Home / Companies / Snyk / Blog / Post Details
Content Deep Dive

Creating an automated cloud infrastructure testing tool with Terraform and PyTest

Blog post from Snyk

Post Details
Company
Date Published
Author
Drew Wright
Word Count
3,559
Language
English
Hacker News Points
-
Summary

The author created an automated testing tool called autotest using Terraform and PyTest to verify cloud infrastructure compliance and security with Fugue. The design involved three steps: deploying modular infrastructure using Terraform, creating a Fugue environment and scanning it, and retrieving and verifying scan results. To achieve this, the author used PyTest's fixtures to manage dependencies and abstract away implementation details. They defined custom fixtures for Terraform deployment, Fugue environment creation, and scan initiation, which were then used in tests to verify infrastructure compliance. The autotest tool provides a clean and powerful abstraction layer for testing cloud infrastructure and ensures that it is scanned correctly by Fugue.