From the course: Advanced Terraform
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Introduction to modules - Terraform Tutorial
From the course: Advanced Terraform
Introduction to modules
- [Instructor] A Terraform module is a self-contained, encapsulated set of resources. It's useful to think of a module as a sub configuration. It has input and output variables and modules are written in HCL. HashiCorp and open source contributors maintain a large library of modules for Terraform users. Modules can vastly simplify a configuration by reducing the number of lines needed to execute complex configurations. GCP modules are available for service accounts, compute engine VMs, GKE, and many more. Terraform modules cannot be deployed by themselves. They have to be declared in a root module. All configurations have a root module. The root module contains the resources declared in the .tf files of a configuration. External modules that are declared in the root module are called child modules. Child modules are imported into the root module using the module HCL declaration. A module declaration in the root module…
Contents
-
-
-
-
Input variables5m 52s
-
(Locked)
Using input variables6m 23s
-
(Locked)
Output variables5m 50s
-
(Locked)
Sensitive data4m 10s
-
(Locked)
Looping with count7m 59s
-
(Locked)
Looping with for_each3m 26s
-
(Locked)
Expressions and functions6m 33s
-
(Locked)
Introduction to modules2m 38s
-
(Locked)
Using Terraform modules3m 55s
-
-
-
-