From the course: DevOps Foundations: Infrastructure as Code

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Terraform

Terraform

- [Instructor] Time for some fun using Terraform for infrastructure provisioning. First, let's look in our Amazon console. Oh, look, under EC2, I've got a bunch of running servers prepared to become part of a Kubernetes cluster. So, you've got some running cloud servers. "So what?" you ask. We did that in the previous lab. Well, the spiffy thing here is that these are all generated from infrastructure as code using Terraform. Let's go look at that Terraform code. I've forked an open-source project called Cube Spray to do this, and down in its contrib/terraform/aws directory, it has the Terraform code to make an entire Kubernetes cluster in Amazon. So the first key item here is the terraform.tfvars file, and this holds common configuration parameters that you might want to tweak in a normal Kubernetes installation. Note here that we've got 3 workers running. Then the primary Terraform code is in create-infrastructure.tf.…

Contents