I've been reading up the Terraform standard module structure and I see they want a main, outputs, and variables file in every one.

I have a pair of modules where everything fits in a single tmux window, is it really worth breaking out into three files for such a small module or is this a rule that is really only applied at scale?

1 Answer 1


While it's best practice to use variables.tf and outputs.tf, both variables and outputs can be declared in any file - so in a way it just boils down to both personal preference along with any formatting rules that may exist in your project or team.

Personally, I prefer to always use these files as it helps me keep things tidy and organized.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.