rso_instance_templates (Data Source)¶
The OS templates an instance can be cloned from.
Example Usage¶
# A virtual machine from an OS template, reachable with your SSH key.
data "rso_instance_templates" "all" {}
variable "template_name" {
description = "Name of the OS template to clone."
type = string
default = "ubuntu-26.04"
}
variable "ssh_public_key" {
description = "SSH public key installed for the default user."
type = string
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyReplaceMeWithYourOwnPublicKey000 example"
}
resource "rso_instance" "vm" {
name = "tf-example-vm"
template = data.rso_instance_templates.all.by_name[var.template_name]
cpus = 1
memory_mb = 1024
root_disk_gb = 20
ssh_public_key = var.ssh_public_key
}
output "instance_vmid" {
value = rso_instance.vm.vmid
}
Schema¶
Read-Only¶
by_name(Map of String) Template id by template name, fordata.rso_instance_templates.all.by_name["ubuntu-26.04"].templates(List of Object) Every template with itsid,nameanddescription. (see below for nested schema)
Nested Schema for templates¶
Read-Only:
description(String)id(String)name(String)