resource "yandex_compute_instance" "vm-test1" {
count = 0
name = "test1"
resources {
cores = 2
memory = 2
}
boot_disk {
initialize_params {
image_id = "fd8hafusaj96qep5ub6h"
}
}
network_interface {
subnet_id = yandex_vpc_subnet.subnet_terraform.id
nat = true
}
metadata = {
user-data = "${file("meta.yaml")}"
}
}
resource "random_password" "password" {
length = 16
special = true
override_special = "!#$%&*()-_=+[]{}<>:?"
}
Как передать значение random_password.password.result в user-data plain_text_passwd?
#cloud-config
users:
- name: evgeniy
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaCdfe1yc2EAAAADAQABAAABgQC2z+3rwfy8Sj5e9fDWmgXGaUrupWtQ+N6puT+Z2G0Edfs2Beqr2ImWtU7eVSJmWg/J4Ro9jZBi5+/nuuXG1ky6i0UmeFztUhIG4Bg5pxPmvCpGBs1MrZmLZjgIRdxn63TSo>
- name: Ubuntu
plain_text_passwd: '123'
home: /home/ubuntu
shell: /bin/bash
lock_passwd: False
gecos: Ubuntu
sudo: ALL=(ALL) ALL