Recent posts

How to use Terraform for_each correctly

3 minute read

Terraform language provides the for_each meta-argument to create many resources from a key-value data structure. However, if not used properly, the for_each meta-argument can produce unexpected results.

Testing Kubernetes resources with Kuttl

1 minute read

In Kubernetes the infrastructure that runs an application is described by some YAML manifests. While application source code is tested with additional code written almost always in the same language, manifest describing the architecture are almost never tested. It means that changes in the manifests affect immediately the infrastructure.

Testing Infrastructure as Code with Python

2 minute read

Infrastructure code is considered 100% code but often good software principle, like testing, are not applied. Apart from checking the correctness of code, testing documents how code should behave, as well. In this post I will show how to test a Terraform module using the Python module tftest along with the testing framework pytest.

Customize Go tests with Flag options

1 minute read

Often some tests of a Go package need to interact with another system. You can mock it but at a certain point, the tests should run against a real system located at a certain address, using a some credentials, and so on. The real system has some parameters that should not be hardcoded because they are ephemeral or because is not safe. To customize these p...