by shigemk2


Terraform Modules


Root Modules

Every Terraform configuration has at least one module, known as its root module, which consists of the resources defined in the .tf files in the main working directory.

Terraformを使っているworking directoryがここ。バックエンドがlocalだったら大体Root Modulesにtfstateファイルがあったりする。

Child Modules

A Terraform module (usually the root module of a configuration) can call other modules to include their resources into the configuration. A module that has been called by another module is often referred to as a child module.


Publised Modules

In addition to modules from the local filesystem, Terraform can load modules from a public or private registry. This makes it possible to publish modules for others to use, and to use modules that others have published.

DocuerHubだとかnpmみたいにレジストリに上げてみんなで利用するModule。野良メンテのModuleもあれば企業がメンテしてるModuleもある。 TFCかTFEを使えばprivate registryが利用できるけれど、適当にサーバーを立ててレジストリサーバーにできるかどうかは知らない。