Learn DevOps: Infrastructure Automation With Terraform
4.3 (7,702 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
44,890 students enrolled

Learn DevOps: Infrastructure Automation With Terraform

Learn how to automate your infrastructure with terraform. Covers Terraform with AWS, Packer, Docker, ECS, EKS, Jenkins
4.3 (7,702 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
44,890 students enrolled
Created by Edward Viaene
Last updated 6/2020
English
English, French [Auto], 5 more
  • German [Auto]
  • Indonesian [Auto]
  • Italian [Auto]
  • Portuguese [Auto]
  • Spanish [Auto]
This course includes
  • 8 hours on-demand video
  • 1 article
  • Access on mobile
  • Certificate of Completion
What you'll learn
  • Understand, use and apply terraform
  • Know when to use different features
  • Use terraform with AWS
  • Use terraform with Packer to create custom images
  • Be able to apply DevOps techniques using terraform
Course content
Expand all 91 lectures 08:03:09
+ Course Introduction
3 lectures 04:35
Discussions and Support
00:15

Contains useful information for this course

Procedure Document
01:14
+ Introduction to terraform
4 lectures 15:01

Introduction to what terraform is.

Preview 02:59

An explanation of how to install terraform on Windows / MacOS / Linux

Preview 02:24

An alternative installation procedure using Vagrant. This will allow you to use exactly the same setup I have!

Preview 02:34
+ Terraform basics
5 lectures 29:52

In this lecture I'll explain the basics of HCL (the HashiCorp Configuration Language) by using simple examples

Preview 13:10

First steps in terraform: learn how to spin up your first instance. First: AWS account setup.

Preview 05:03

First steps in terraform: learn how to spin up your first instance

Preview 06:47

Summary of the first steps in terraform

First steps in terraform - summary
01:48
Terraform Variable Types
03:04

Test your knowledge

Quiz 1
2 questions
+ Terraform basics
17 lectures 01:15:59

How to use variables in terraform

Variables
04:35

A demo of how to use variables in terraform

Demo: variables
04:23

Provision software on your instance using chef / ansible / puppet / shell scripts.

Software Provisioning
05:47

A demo to show you how to provision software using a shell script

Demo: Software provisioning
06:59

In this demo I'll show you how to use WinRM to provision a Windows Server

Demo: Windows Server Provisioning
07:29

Using outputs in terraform you can output information on screen

Outputting attributes
02:40

A demo showing how outputs work

Demo: Outputting Attributes
02:53

The terraform.tfstate can be stored remotely. This helps collaboration when using Terraform within a team. 

Remote state
06:41

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.

Demo: Remote state
03:26

You can use datasources to retrieve external information like AWS IP addresses, AMI IDs, and so on.

Data Sources
02:50

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.

Demo: Data Sources
02:14

You can use a template provider in terraform to render templates into strings

Templates
03:10

There's more than just AWS in terraform. An overview of other providers.

Other Providers
02:30

An overview on how to use modules in terraform

Modules
02:50

A demo showing you how to use external modules. This demo will launch a full consul cluster using an external terraform module

Demo: An external Module
03:18

An overview of useful terraform commands

Terraform Commands Overview
05:28

A demo of a few useful terraform commands, including terraform show, terraform graph, terraform import, terraform taint, terraform untaint

Demo: Terraform Commands
08:46

Test your knowledge!

Quiz 2
8 questions
+ Terraform with AWS
26 lectures 02:02:25

An introduction to AWS VPCs (Virtual Private Cloud) - Part 1

Introduction to VPCs
02:37

An introduction to AWS VPCs (Virtual Private Cloud) - Part 2

Introduction to VPCs - Part II
05:02

An introduction to AWS VPCs (Virtual Private Cloud) - Part 3

Introduction to terraform - Part III
03:25

A demo showing you how to launch a VPC with an internet gateway and a NAT gateway

Demo: VPCs and NAT
05:59

Now that we have created our VPC, we can launch EC2 instances in the VPC

Launching EC2 instances in the VPC
04:45

This is a demo showing you how to launch instances within a VPC

Demo: Launching instances in a VPC
03:55

Test your knowledge!

Quiz 3
10 questions

This lecture shows you how to use EBS (Elastic Block Storage) with an instance

EBS Volumes
03:32

This demo shows you how to attach EBS volumes to EC2 instances

Demo: EBS volumes
04:55

Userdata can be used to execute commands at launch time

Userdata
05:17

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.

Demo: Userdata
07:17

This lecture explains the difference between private static IPs, EIPs and DNS (Route53)

Static IPs, EIPs, and Route53
04:49

This demo shows how to use Route53 to create DNS zones in AWS

Demo: Route53
03:33

This lecture explains how to spin up an RDS (relational database service) instance with terraform on AWS

RDS
07:10

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..

Demo: RDS
04:19

IAM stands for Identity & Access Management. In this lecture I explain the different possibilities for access management. I explain users, groups, policies, and roles.

IAM
05:18

In this demo I create a group with an AWS group policy and attach it to a user.

Demo: IAM users and groups
00:55

IAM roles can be used to assume (temporary) access. In this lecture I explain how this works.

IAM Roles
02:14

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.

Demo: IAM Roles
04:03

A lecture explaining how to setup autoscaling in AWS using terraform

Autoscaling
07:46

A demo of autoscaling using terraform on AWS

Demo: Autoscaling
04:40

Introduction into Elastic Load Balancers and Application Load Balancers in AWS

Introduction to Elastic Load Balancers (ELB)
02:52

This lecture explains how to use ELBs in terraform with a static list of instances and an autoscaling group

ELBs in terraform
04:38

A demo showing how to use terraform with an ELB together with autoscaling

Demo: ELB with autoscaling
06:47

An introduction of how the Application Load Balancer (ALB) works in terraform

Application Load Balancer (ALB)
04:10

ElasticBeanstalk (AWS's PaaS solution) setup using Terraform

Elastic Beanstalk
02:51

ElasticBeanstalk (AWS's PaaS solution) setup demo using Terraform

Demo: Elastic Beanstalk
09:36

Test your knowledge!

Quiz 4
11 questions
+ Advanced Terraform Usage
10 lectures 58:18
Introduction to Interpolation
06:34
Conditionals
01:31
Demo: Interpolation and Conditionals
06:02
Built-in Functions
08:00
Demo: Built-in Functions
07:04

Since terraform 0.12 you can use loops with for and for each. This lecture explains how and when to use for/foreach

For and For Each Loops
05:39

For loops demo in terraform

Demo: For loops
06:15

For-each loops demo in terraform

Demo: For each loops
03:56
Terraform Project Structure
03:02
Demo: Project Structure in Terraform
10:15
+ Packer
5 lectures 32:47

With packer AMIs can be created that can be used to launch an EC2 instance.

Packer introduction
03:24

Where does Terraform fit in the DevOps organization? In this lecture I show you an example workflow with terraform, packer and jenkins

Terraform with Packer and Jenkins
03:36

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

Demo: Packer with terraform
02:55

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

Terraform with Packer and Jenkins (Part I)
07:07

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

Terraform with Packer and Jenkins (Part II)
15:45

Test your knowledge

Quiz 5
3 questions
+ Docker on AWS using ECS and ECR
8 lectures 46:25

This lectures gives an introduction of Docker

Introduction to Docker
04:54

This lecture explains how to use Docker on AWS using terraform

Docker on AWS
03:18

This lecture shows how to build docker images that can be pushed on ECR

Building Docker images
06:16

In this demo I show how to push a docker built image to ECR

Demo: Build NodeJS app and push to ECR
04:26

This lecture explains part I of the setup of ECS using terraform, with autoscaling and IAM roles

ECS - Part I
04:33

This lecture explains part II of the setup of ECS using terraform, with autoscaling, IAM roles, ECS task definitions and ECS Service definitions

ECS - Part II
06:19

This demo shows you how to run the pushed NodeJS app on ECS

Demo: Running a NodeJS app on ECS
06:06

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

Demo: Terraform with Jenkins, ECR and ECS
10:33
+ Module Development
5 lectures 32:26
Introduction to Module Development
01:32
ECS + ALB Module Overview
04:49
Demo: ECS + ALB Module (part I)
11:12
Demo: ECS + ALB Module (Part II)
07:13
Demo: ECS + ALB Module (Part III)
07:40
+ AWS CodePipeline (Continuous Delivery / Deployments)
4 lectures 42:00

Introduction to CodePipeline with CodeCommit, CodeBuild, and CodeDeploy. Includes architecture diagrams on how to deploy to ECS with CodeDeploy

Introduction to AWS CodePipeline
08:27

Demo showing how to deploy to ECS with CodePipelines, CodeCommit, CodeBuild, CodeDeploy, using green/blue deployments.

Demo: CodePipeline (part I)
13:21

Demo showing how to deploy to ECS with CodePipelines, CodeCommit, CodeBuild, CodeDeploy, using green/blue deployments.

Demo: CodePipeline (part II)
05:15

Demo showing how to deploy to ECS with CodePipelines, CodeCommit, CodeBuild, CodeDeploy, using green/blue deployments.

Demo: CodePipeline (Part III)
14:57
Requirements
  • To be able to do the demos yourself, you should have an AWS account. You can open one for free and I explain how to open one in the course.
Description

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

This course includes english captions.

Who this course is for:
  • This course is great if you're in an Ops or DevOps position and you want to learn about automation using terraform