To test terraform module, you can place your module into folder, let's call module. In your test that you place in the root directory, you can have the following: run " resource - group-name-created-correctly" { variables { prefix = "test" } module { source = "./modules" } command = plan assert { condition = output.resource_group_name == "myrg" error_message = "Resource group created is not expected" } } Then run terraform init and terraform test to execute your tests. As shown in the diagram above, you need to declare output from your module - and in this case we have our output called resource_group_name. All we need to do is, use the output keyword and append whatever variable we have just output. The output full code. # Outputs output "storage_account_name" { description = "The name of the storage account" value = azurerm_storage_account.example.name }