Automating Linux Server Deployments with Terraform and Linode

From LearnLinux.tv Wiki
Jump to navigationJump to search

Overview

In this video, Jay shows how to build Linode instances by using Hashicorp's Terraform. Terraform is an awesome tool for automating the building of cloud resources.

Relevant Links
Original Video

First example

 provider "linode" {
     token = "d95ab522b717f75439d6a84455eb4239dae836d73419ff3a6dc1067e9d7de834"
 }
 
 resource "linode_instance" "my_linode" {
     label = "my_linode"
     image = "linode/debian10"
     region = "us-east"
     type = "g6-nanode-1"
     root_pass = "Supersecret!!!"
 }

Second example

 variable "linode-api-key" {}
 variable "root-password" {}
 
 provider "linode" {
     token = var.linode-api-key
 }
 
 resource "linode_instance" "my_linode_2" {
     label = "my_linode_2"
     image = "private/7692309"
     region = "us-east"
     type = "g6-nanode-1"
     root_pass = var.root-password
 }