Automating Linux Server Deployments with Terraform and Linode

YouTube player

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
 }

Notable Replies

  1. I have just tried this and it needs updating:
    Error: Failed to query available provider packages

    was there something else you had installed previously?

    or has it changed and you need to install the Linode CLI?

Continue the discussion at community.learnlinux.tv

Participants

Avatar for system Avatar for Tallion_o7