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 variables and outputs enable more flexible and modular code by breaking out hard-coded values.
variable "instance_type" {
type = string
default = "t2.micro"
}
locals {
service_name = "example-service"
owner = "your_name"
}
output "instance_ip" {
value = aws_instance.example.public_ip
}
Input variables can be set in several ways, ranked in order of precedence from lowest to highest:
TF_VAR_
followed by the variable name..tfvars
files: Store values in .tfvars
files..auto.tfvars
files: These files will be applied over the .tfvars
files.-var
or -var-file
options: Pass values when issuing the terraform plan or terraform apply commands.Variables can hold different value types:
Type checking happens automatically in Terraform. You can also write your own validation rules.
When using sensitive data in variables, like a database password, add the sensitive = true
attribute when defining the variable. This will cause those data to be masked in the Terraform plan output to prevent leaking credentials.
Also, avoid storing sensitive data in files, and consider using these options for passing in those data:
-var
command