Terraform 1.6 adds a test framework for enhanced code validation, which extends possibilities of testing infrastructure. If you are interested how to use Terraform test command, please check tutorial Write Terraform Tests. On my GitHub you can find repository AWS serverless REST API, in which I prepared sample test in file compute_producer.tftest.hcl.