Terraform has gained a lot in popularity lately and is the tool you need to master if you are or about to get into a Ops / DevOps role. You typically use a technology like Ansible, Chef, or Puppet to automate the provisioning of software. Terraform starts from the same principle, infrastructure as code, but focusses on the automation of the infrastructure itself. Your whole Cloud infrastructure (instances, volumes, networking, IPs) can be described in terraform.
Terraform has gained a lot in popularity lately and is the tool you need to master if you are or about to get into a Ops / DevOps role. You typically use a technology like Ansible, Chef, or Puppet to automate the provisioning of software. Terraform starts from the same principle, infrastructure as code, but focusses on the automation of the infrastructure itself. Your whole Cloud infrastructure (instances, volumes, networking, IPs) can be described in terraform.
In this course you'll learn how to use terraform to automate your infrastructure. I will first show you the basics of terraform and will then explain how to automate infrastructure on AWS using terraform. You can open an AWS account for free to do the labs. I also provide a lot of code examples which you can immediately use to automate your own infrastructure.
Update (Oct-2016):
Added AWS Autoscaling lectures
Added Terraform+Packer Jenkins integration lectures
Added Terraform with Docker on AWS (ECR and ECS)
Added Terraform with Jenkins workflow using ECR and ECS
Update (Dec-2016):
Added a lecture about useful terraform commands
Added a demo on how to use terraform show/graph/taint/untaint/import
Added a lecture and demo about Elastic Beanstalk on AWS
Update (Jun-2018):
Terraform for Windows setup + puttygen
Interpolation
Conditionals
Built-in functions
Module development with an ECS + ALB module demo
Setting up a hosted Kubernetes cluster using AWS EKS
Update (Nov-2019):
Terraform-0.12 updates
Lectures covering new variable approach in terraform-0.12
For & For Each loops
Update (March-2020):
CodePipeline lectures
Updated lectures with new AWS UI
Updated jenkins-packer-demo demo
Update (December-2020):
Advanced Module development
Lectures and demos covering new Terraform 0.13 features
Terraform lock file (terraform 0.14)
State manipulation
Update (December-2020):
A complete new section on the HashiCorp Terraform Certification has now been added.
Update (January-2022):
Refactoring modules with the "moved" block
Cloud Development Kit For Terraform (CDKTF)
This course includes english captions.
Contains useful information for this course
Introduction to what terraform is.
An explanation of how to install terraform on Windows / MacOS / Linux
An alternative installation procedure using Vagrant. This will allow you to use exactly the same setup I have!
In this lecture I'll explain the basics of HCL (the HashiCorp Configuration Language) by using simple examples
First steps in terraform: learn how to spin up your first instance. First: AWS account setup.
First steps in terraform: learn how to spin up your first instance
Summary of the first steps in terraform
Test your knowledge
How to use variables in terraform
A demo of how to use variables in terraform
Provision software on your instance using chef / ansible / puppet / shell scripts.
A demo to show you how to provision software using a shell script
In this demo I'll show you how to use WinRM to provision a Windows Server
Using outputs in terraform you can output information on screen
A demo showing how outputs work
The terraform.tfstate can be stored remotely. This helps collaboration when using Terraform within a team.
This demo shows how to store the remote terraform state in an S3 bucket. By changing a few flags you can also use it to save it to a consul cluster.
You can use datasources to retrieve external information like AWS IP addresses, AMI IDs, and so on.
A demo using the AWS Region IP ranges to create a security group that only allows access from eu-west-1 and eu-central-1 in AWS.
You can use a template provider in terraform to render templates into strings
How to use templates in terraform 0.12 onwards
There's more than just AWS in terraform. An overview of other providers.
An overview on how to use modules in terraform
A demo showing you how to use external modules. This demo will launch a full consul cluster using an external terraform module
An overview of useful terraform commands
A demo of a few useful terraform commands, including terraform show, terraform graph, terraform import, terraform taint, terraform untaint
Test your knowledge!
An introduction to AWS VPCs (Virtual Private Cloud) - Part 1
An introduction to AWS VPCs (Virtual Private Cloud) - Part 2
An introduction to AWS VPCs (Virtual Private Cloud) - Part 3
A demo showing you how to launch a VPC with an internet gateway and a NAT gateway
Now that we have created our VPC, we can launch EC2 instances in the VPC
This is a demo showing you how to launch instances within a VPC
This lecture shows you how to use EBS (Elastic Block Storage) with an instance
This demo shows you how to attach EBS volumes to EC2 instances
Userdata can be used to execute commands at launch time
In this demo userdata will be used to format and mount an EBS volume if no filesystem is present. This way EBS volumes can be persisted in an automated way when the instance needs replacement.
This lecture explains the difference between private static IPs, EIPs and DNS (Route53)
This demo shows how to use Route53 to create DNS zones in AWS
This lecture explains how to spin up an RDS (relational database service) instance with terraform on AWS
In this demo I will spin up an RDS instance (using RDS subnets, RDS parameter groups, and security groups) and will connect from an EC2 instance to MariaDB..
IAM stands for Identity & Access Management. In this lecture I explain the different possibilities for access management. I explain users, groups, policies, and roles.
In this demo I create a group with an AWS group policy and attach it to a user.
IAM roles can be used to assume (temporary) access. In this lecture I explain how this works.
IAM roles can be used to assume (temporary) access. In this lecture I show you how to attach a role to an EC2 instance that will give permissions to read/write to an S3 bucket.
A lecture explaining how to setup autoscaling in AWS using terraform
A demo of autoscaling using terraform on AWS
Introduction into Elastic Load Balancers and Application Load Balancers in AWS
This lecture explains how to use ELBs in terraform with a static list of instances and an autoscaling group
A demo showing how to use terraform with an ELB together with autoscaling
An introduction of how the Application Load Balancer (ALB) works in terraform
ElasticBeanstalk (AWS's PaaS solution) setup using Terraform
ElasticBeanstalk (AWS's PaaS solution) setup demo using Terraform
Since terraform 0.12 you can use loops with for and for each. This lecture explains how and when to use for/foreach
For loops demo in terraform
For-each loops demo in terraform
The terraform providers lock file was introduced in terraform 0.14 and will from now on keep track of your provider and module dependency versions.
Terraform uses a state file (local / remote) that you can list resources of, read, and manipulate
Demo showing how to manipulate the state file in terraform
With packer AMIs can be created that can be used to launch an EC2 instance.
Where does Terraform fit in the DevOps organization? In this lecture I show you an example workflow with terraform, packer and jenkins
Packer can be integrated with terraform. This workflow shows how to create a workflow where packer creates the AMI and terraform launches the EC2 instance with the correct AMI ID
This demo shows a full cycle of an app in github, the building of a custom AMI with packer in Jenkins and the provisioning and deployment with Terraform
This lectures gives an introduction of Docker
This lecture explains how to use Docker on AWS using terraform
This lecture shows how to build docker images that can be pushed on ECR
In this demo I show how to push a docker built image to ECR
This lecture explains part I of the setup of ECS using terraform, with autoscaling and IAM roles
This lecture explains part II of the setup of ECS using terraform, with autoscaling, IAM roles, ECS task definitions and ECS Service definitions
This demo shows you how to run the pushed NodeJS app on ECS
In this demo I show you how to run a Jenkins workflow to build docker images, push the image to ECR, and use terraform to update ECS with the latest docker image
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.