Using Terraform
Last updated
Was this helpful?
Was this helpful?
resource "i3dnet_flexvm_node" "my-node" {
cloud_id = i3dnet_flexvm_cloud.my-cloud.id
}resource "i3dnet_flexvm_vm" "my-vm" {
cloud_id = i3dnet_flexvm_cloud.my-cloud.id
name = "test-gaming-vm1"
description = "Test Gaming VM 1"
instance_type_name = "vm.gpu.1rtx4000.15c.248g"
image_name = "ubuntu-2404-server-amd64"
ssh_keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHwdgjY0AlmkeLknBpoVmJg/quNSifyBHEK1MREpV4Ri john.doe@i3d.net"]
# Optional free-form labels for grouping in the monthly usage report.
tags = ["project:odyssey", "env:build"]
}resource "i3dnet_flexvm_vm" "my-vm-with-user-data" {
cloud_id = i3dnet_flexvm_cloud.my-cloud.id
name = "test-gaming-vm2"
description = "Test Gaming VM 2"
instance_type_name = "vm.gpu.1rtx4000.15c.248g"
image_name = "ubuntu-2404-server-amd64"
user_data_file = abspath("${path.module}/cloud-init.yaml")
}data "i3dnet_flexvm_cloud" "existing" {
id = "019256ab-1554-73a7-b091-f024b0a724ea"
}
resource "i3dnet_flexvm_vm" "my-vm" {
cloud_id = data.i3dnet_flexvm_cloud.existing.id
name = "development-ubuntu-2404"
instance_type_name = "vm.4c.8g"
image_name = "ubuntu-2404-server-amd64"
ssh_keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHwdgjY0AlmkeLknBpoVmJg/quNSifyBHEK1MREpV4Ri john.doe@i3d.net"]
}data "i3dnet_flexvm_node" "example" {
cloud_id = "019256ab-1554-73a7-b091-f024b0a724ea"
id = "019256ab-1554-73a7-b091-f024b0a724eb"
}
output "node_serial" {
value = data.i3dnet_flexvm_node.example.serial
}