Using Terraform Test for testing your terraform code
<p>Hashicorp has introduced its testing framework officially (terraform test).</p>
<p><strong><em>Note: This testing framework is available in Terraform v1.6.0 and later.</em></strong></p>
<p>Terraform tests let authors validate that module configuration updates do not introduce breaking changes. Tests run against test-specific, short-lived resources, preventing any risk to your existing infrastructure or state.</p>
<p>By default, tests within Terraform create real infrastructure and can run assertions and validations against that infrastructure. This is analogous to integration testing because you are testing Terraform’s core functionality by executing operations and validating the infrastructure Terraform creates</p>
<p>Lets have a simple example to explain how it works.</p>
<p><a href="https://medium.com/@monusraj/using-terraform-test-for-testing-your-terraform-code-b6fdbe170ba0"><strong>Visit Now</strong></a></p>