Terratest continues to be an interesting option for infrastructure testing. It is a Golang library that makes it easier to write automated tests. Using infrastructure-as-code tools such as Terraform, you can create real infrastructure components (such as servers, firewalls or load balancers) to deploy applications on them and then validate the expected behavior using Terratest. At the end of the test, Terratest can undeploy the apps and clean up resources. Our teams report that this approach of testing deployed infrastructure components fosters confidence in the infrastructure as code. We see our teams writing a variety of infra security tests for application components and their integrations. For example, detecting misconfigurations, verifying access control (e.g., to check whether certain IAM roles or permissions are correctly configured or to ensure only authorized users have access to specific resources) and network security tests to verify prevention of unauthorized traffic to sensitive resources to name a few. This allows security testing to be shifted left and provides feedback during development itself.
Terratest nos llamó la atención en el pasado como una opción interesante para pruebas de infraestructura. Desde entonces, nuestros equipos lo han utilizado y están muy entusiasmados por su estabilidad y la experiencia que proporciona. Terratest es una biblioteca de Golang que hace más fácil escribir pruebas automáticas para el código de infraestructura. Utilizando herramientas de infraestructura como código, como Terraform, es posible crear componentes de infraestructura reales (como servidores, firewalls o balanceadores de carga) para desplegar aplicaciones en ellos y después validar el comportamiento esperado utilizando Terratest. Al finalizar las pruebas, Terratest puede retirar las aplicaciones y limpiar los recursos. Esto lo hace muy útil para pruebas de infraestructura de extremo a extremo en un entorno real.
We widely use Terraform as code to configure a cloud infrastructure. Terratest is a Golang library that makes it easier to write automated tests for infrastructure code. A test run creates real infrastructure components (such as servers, firewalls or load balancers), deploys applications on them and validates the expected behavior using Terratest. At the end of the test, Terratest can undeploy the apps and clean up resources. This makes it largely useful for end-to-end tests of your infrastructure in a real environment.