aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-02-04 13:08:19 +0100
committerEgor Tensin <egor@tensin.name>2024-02-04 13:08:19 +0100
commit702505f353aff2cd43f11fef2ac1292b6aa74a9a (patch)
treeed89f9c1297c0eb4de0633b593ac69e06dee6012
parentdigitalocean/server: customizable alerts w/ higher thresholds (diff)
downloadinfra-terraform-702505f353aff2cd43f11fef2ac1292b6aa74a9a.tar.gz
infra-terraform-702505f353aff2cd43f11fef2ac1292b6aa74a9a.zip
yandex/server: refactoring
-rw-r--r--yandex/server/main.tf11
1 files changed, 6 insertions, 5 deletions
diff --git a/yandex/server/main.tf b/yandex/server/main.tf
index b9d4650..97b326f 100644
--- a/yandex/server/main.tf
+++ b/yandex/server/main.tf
@@ -3,6 +3,11 @@ locals {
port = var.ssh_port
users = [var.user]
})
+ user_data = templatefile("${path.module}/../../etc/cloud-init.cfg", {
+ user = var.user
+ ssh_keys = var.ssh_keys
+ sshd_config = local.sshd_config
+ })
}
resource "yandex_compute_instance" "this" {
@@ -30,11 +35,7 @@ resource "yandex_compute_instance" "this" {
}
metadata = {
- user-data = templatefile("${path.module}/../../etc/cloud-init.cfg", {
- user = var.user
- ssh_keys = var.ssh_keys
- sshd_config = local.sshd_config
- })
+ user-data = local.user_data
}
allow_stopping_for_update = true