resource "yandex_compute_instance" "vm" { count = 2 name = "vm${count.index}" platform_id = "standard-v1" boot_disk { initialize_params { image_id = "fd87j6d92jlrbjqbl32q" # ubuntu 22.04 size = 8 } } network_interface { subnet_id = yandex_vpc_subnet.subnet1.id nat = true } resources { core_fraction = 5 cores = 2 memory = 2 } metadata = { user-data = "${file("users.yml")}" } }