Is there a way to force an exit or not process modules?

I would like to be able to compare an input variable to terraform.workspace and if they do not match, exit, or skip all the modules. I would like to match my “environment” with a defined terraform workspace having the same name. For instance, if I am working in the “tst” environment then I would like to use a terraform workspace called “tst”.

With that concept in mind, I would like to stop processing if they do not match.

I have not seen any function or commands that control processing… Am I missing something?

Do I need to create a script to test and then call terraform commands?

Thank you for your help and consideration.

Gary