Chapter 5. Developing Modules
In software development, a common point of discussion is around scopes and contexts. They shape how we organize, protect, and reuse code—reducing ambiguity and minimizing friction during development, execution, and maintenance.
Up to this point, we’ve focused on two primary scopes in TF: expressions and blocks. Many times, these are indeed the important scopes to consider. However, there’s another major scope: the module.
In TF, everything is encapsulated within a module, so at all times, you’re developing a module in some fashion. It could be oriented around a number of different aspects of a software project, including the cloud services that host and service your application stack as well as the applications themselves.
In this chapter, you’ll see different types of modules and how they may be used strategically to create effective TF projects that follow the shape of your organization. You’ll learn how to develop reusable modules for use by other members of your organization or even the general public. Finally, you’ll get an overview of useful practices that, with thoughtful application, may be combined into a successful codebase—and practices to avoid or be especially judicious about.
Types of Modules
As stated, everything in a TF project is encapsulated within a module. This has implications both where certain information is utilized and how information may be abstracted or protected.
Here is an overview of the various types of modules and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access