Skip to content

Use the official Linode Terraform provider #12

@displague

Description

@displague

Use https://github.com/terraform-providers/terraform-provider-linode (docs)

  • Add provider "linode" {} block to linode/*/main.tf
  • Use Linode APIv4 token in provider block (and define and document this variable) (I assume the old APIv3 API Key (not compatible) was being pulled from the environment in the old plugin, since no variable for this exists)
  • Change linode_linode resources to linode_instance
    • Change region values (from int ("6" .. or is it "Newark") to the new string keys ("us-east"))
    • Change image values (from "Debian 9" to "linode/debian9")
    • Remove kernel field (it was using the default and is not a valid field in the simple linode_instance workflow (to specify a kernel, disks and configs must be created as struct fields in the linode_instance -- not necessary for RedBaron ))
    • Rename ssh_key = "..." to authorized_keys = [ "..." ] (string to array)
    • Rename root_password to root_pass (or just remove it and the random_string resource attached to it. The terraform provider will generate and throw away a random password.)
    • Rename name to label
    • Rename size to type
    • Change type values (from "Linode 1024" to new keys "g6-standard-1", given in the gist below)
  • Remove the compiled terraform plugin from the repo (terraform init will automatically download the plugin from the terraform.io registry)

New ids for images, kernels, instance types, regions: https://gist.github.com/displague/3c1728fdf4ff2bacf6960a9b8c6ea73f

These changes are incompatible with previous Linode terraform deployments (and the community plugin).

Should this work be done as a new cloud provider directory, deprecating the old one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions