How to maintain variables that point to data such as user data scripts

Hi,
So I have encountered an article that explains a way to maintain modules in git:https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d

the article describes a way to reference a module from git and to a specific git commit so that changes will not apply to different environments such as production until desired.

I wanted to know if this is applicable to variables pointing to files such as user data scripts, and if not what is best practice for that.

thanks : )