sless-primer/VM/main.tf

43 lines
1.4 KiB
HCL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 2026-03-25 main.tf для примера с vApp + ВМ (Виртуальный датацентр Nubes).
// Провайдер nubes. Sless-провайдер не нужен пример чисто инфраструктурный.
terraform {
required_providers {
nubes = {
source = "terra.k8c.ru/nubes/nubes"
version = "5.0.51"
}
sless = {
source = "terra.k8c.ru/naeel/sless"
version = "~> 0.1"
}
}
}
# ------------------------------------------------------------------
# Переменные
# ------------------------------------------------------------------
variable "vm_public_key" {
type = string
sensitive = true
description = "Публичный SSH-ключ для ВМ. Приватный ключ: ~/terra/sless/examples/VM/vm_key"
}
variable "api_token" {
type = string
sensitive = true
description = "Nubes API token"
}
# ------------------------------------------------------------------
# Провайдер
# ------------------------------------------------------------------
# API Dashboard (для Terraform-провайдеров): https://deck-api-test.ngcloud.ru/api/v1/index.cfm
# UI облака (только браузер): https://deck-test.ngcloud.ru/
provider "nubes" {
api_token = var.api_token
api_endpoint = "https://deck-api-test.ngcloud.ru/api/v1/index.cfm"
}