Inputs and outputs
Next, let's look at how to get data into and out of Terraform using input variables and outputs.
Inputs
As we learned in the previous chapter, Terraform operates within the context of a module. That module is scoped physically within a directory. The root module is a special case where its directory is the same as Terraform’s working directory. Whenever you are writing HCL, you are writing within the context of a module, whether the root module or some other module; therefore, you need to consider how to get data into your module and how to get data out of it.
Input variables are an essential design consideration because Terraform modules are simple machines that take inputs and produce outputs.
The input is all about what information the module needs to provision itself, and those inputs can come from wherever. As you design inputs, they should be atomic.
The module should be able to take the input without any additional manipulation or...