Examine the evolution of virtualization technologies from bare metal, virtual machines, and containers and the tradeoffs between them.
Install terraform and configure it to work with AWS
Learn the common terraform commands and how to use them
•Terraform Plan, Apply, Destroy
Use Terraform variables and outputs to improve make our configurations more flexible
Explore HCL language features in Terraform to create more expressive and modular infrastructure code.
Learn to break your code into modules to make it flexible and reuseable
Overview of two primary methods for managing multiple Terraform environments
Techniques for testing and validating Terraform code
Covers how teams generally work with Terraform, including automated deployment with CI/CD
Terraform modules help make your code reuseable, and external modules can be used to provision pre-configured resources.
A module is a container for multiple resources defined within your Terraform configuration, bundled in a reusable fashion.
Modules consist of a collection of .tf
or .tf.json
files kept together within a single directory. We have already been using a default module in previous lessons.
In this lesson, we will learn how to create more structured and reusable modules.
Breaking down the system into different components allows for better organization and specialization within a team.
By using modules, infrastructure specialists can define best practices for infrastructure deployment, which can then be consumed by application developers without having to learn the intricacies of Terraform.
.tf
file in the main working directory.module "web-app" {
source = "../web-app"
}
module "consul" {
source = "hashicorp/consul/aws"
version = "0.1.0
}
module "example" {
source = "github.com/hashicorp/example?ref=v1.2.0"
}
module "example" {
source = "git::ssh://username@example.com/storage.git"
}
Child modules can also receive input variables, allowing for greater customization and adaptability. Meta-arguments like count
, for_each
, providers
, and depends_on
can also be used with child modules.
The Terraform registry hosts many different modules associated with various providers, such as AWS.
These modules can serve as a starting point for your projects
In this lesson, we explored how to organize Terraform projects using modules, create reusable code, and utilize external modules. Modules allow for better organization and specialization within a team, resulting in a more efficient workflow.