IaC Bazaar
LinodePlan-validated

Linode Compute Instance (production-ready)

Hardened Linode VM with cloud-init, disk encryption, reverse DNS, backups, and firewall attachment in one apply.

terraformAlt & Specialty Clouds#linode

Compare Virtual Machines across clouds →

linode-instanceterraform v1.7

Verification

Plan-validated

Passed: module logic verified on a mocked plan — inputs, validation rules, conditional creation and outputs resolve (no real provider, no cloud).

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan: findings disclosed (Checkov)
  • Plan tests (mocked: validation rules · outputs)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live test pending (no cloud run yet)

Last verified 2026-06-28 · how we verify

Documentation

linode-instance

Hardened Linode VM with cloud-init, disk encryption, reverse DNS, backups, and firewall attachment in one apply. Works with Terraform and OpenTofu (>= 1.6), Linode provider >= 3.14, < 4.0.

Secure defaults:

  • Local Disk Encryption (LDE) enabled by default
  • Backups enabled by default
  • SSH-key-first auth: keys are uploaded to the account profile (linode_sshkey) and authorized for root; root_pass stays optional and sensitive. The provider's v3.14 rule (credentials are mandatory when an image is deployed) is enforced with a clear plan-time precondition.
  • Optional VPC interface as the primary NIC (with or without 1:1 NAT), Cloud Firewall attachment (linode_firewall_device), and PTR record (linode_rdns)
  • Cloud-init user data wired through the Linode Metadata service (base64-encoding handled for you)

Usage

module "web" {
  source = "./linode-instance"

  label  = "prod-web1"
  region = "us-ord"
  type   = "g6-standard-2"
  image  = "linode/ubuntu24.04"

  ssh_keys = {
    ops-team = file("~/.ssh/id_ed25519.pub")
  }

  vpc_subnet_id = module.vpc.subnets["app"].id # linode-vpc module
  firewall_id   = module.firewall.firewall_id  # linode-firewall module
  reverse_dns   = "web1.example.com"

  cloud_init_user_data = file("cloud-init.yaml")

  tags = ["env:prod"]
}

Inputs

NameTypeDefaultDescription
labelstringInstance label (required)
regionstringLinode region, e.g. us-ord (required)
typestring"g6-nanode-1"Plan type
imagestring"linode/ubuntu24.04"Image to deploy
ssh_keysmap(string){}label => public key; uploaded + authorized
authorized_keyslist(string)[]Extra literal public keys (not uploaded)
root_passstringnullRoot password (sensitive, 11-128 chars)
disk_encryptionbooltrueLocal Disk Encryption (region must support LDE)
backups_enabledbooltrueLinode Backup service
swap_sizenumber512Swap disk MB
private_ipboolfalseLegacy DC-private IPv4
watchdog_enabledbooltrueLassie watchdog
cloud_init_user_datastringnullPlain-text cloud-init (module base64-encodes)
vpc_subnet_idnumbernullVPC subnet for the primary interface
vpc_ipv4stringnullFixed VPC address (null = auto)
vpc_nat_1_1booltrueKeep public IPv4 via 1:1 NAT on the VPC interface
firewall_idnumbernullCloud Firewall to attach
reverse_dnsstringnullPTR hostname (must already resolve to the IP)
tagslist(string)[]Instance tags

Outputs

NameDescription
instance_idInstance ID
instance_labelInstance label
ip_addressPrimary public IPv4
ipv4_addressesAll IPv4 addresses
ipv6_rangeSLAAC IPv6 range
statusInstance status
ssh_key_idslabel => account SSH key ID
firewall_device_idFirewall device ID (or null)

Requirements

  • Terraform or OpenTofu >= 1.6
  • linode/linode provider >= 3.14, < 4.0
  • You must supply at least one SSH key or a root_pass (provider v3.14 auth requirement — enforced at plan time).
  • disk_encryption and cloud_init_user_data require regions with the LDE and Metadata capabilities respectively.

Verification

Static-validated (fmt, validate, tflint). Live apply/destroy testing pending cloud sandbox availability — see catalog status.

License

Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).