Skip to content
SHC Docs

Example: linode-shc

terraform/examples/linode-shc is infra plus bootstrap only, with no platform resources. It shares a pattern with the Alibaba, CloudStack and OpenStack roots: the bootstrap block is null until vault_pw is set, so one root serves both an infra-only apply and a full one.

  • modules/shc/linode takes a region that supports VPCs and the metadata service, and an instance_type per group.
  • bootstrap = var.vault_pw == "" ? null : { ... }: with the variable empty, the apply stops at the machines, exactly what manage_platform = false did on page 01.
module "shc" {
source = "../../modules/shc/linode"
cluster_name = var.cluster_name
region = var.region
ssh_public_key = var.ssh_public_key
node_groups = {
control = { count = 3, instance_type = var.instance_type, runtime = "docker", control_plane = true }
}
bootstrap = var.vault_pw == "" ? null : {
package = { version = var.shc_version }
vault_password = var.vault_pw
host = var.shc_host
}
}

LINODE_TOKEN is read by the Linode provider; TF_VAR_ssh_public_key and TF_VAR_vault_pw come from the environment.

Terminal window
tofu -chdir=learn/shc/terraform/examples/linode-shc init
tofu -chdir=learn/shc/terraform/examples/linode-shc apply
tofu -chdir=learn/shc/terraform/examples/linode-shc destroy

This page was not walked: no Linode credential is on the learning workstation, and the module has not been applied against a live account.

Next: Example: scaleway-shc.