In the Creating Terraform module and using it locally recipe of this chapter, we studied the steps to create a basic Terraform module.
We can have scenarios where we need to use another file in the module that doesn't describe the infrastructure via Terraform (.tf extension), for example, in the case where the module needs to execute a script locally for operating an internal program.
In this recipe, we will study how to use another file in a Terraform module.
Getting ready
For this recipe, we don't need any prerequisites; we will write the Terraform configuration for the module from scratch.
The goal of this recipe is to create a Terraform module that will execute a Bash script that will perform actions on the local computer (for this recipe, a hello world display will suffice).
Since we will be running a Bash script as an example, we will run Terraform under a Linux system.