by shigemk2

当面は技術的なことしか書かない

Terraform Modules

Terraformのモジュール、いろんな概念があってわかりづらい

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.

他のモジュールからrequiredして利用するためのtfコード群。

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もある。

registry.terraform.io TFCかTFEを使えばprivate registryが利用できるけれど、適当にサーバーを立ててレジストリサーバーにできるかどうかは知らない。

developer.hashicorp.com