stand(FullPipe): vc_nsxt (edge.tf), storage_config fast->SATA, provider 2.0.4
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
resource "nubes_vc_nsxt" "edge" {
|
||||
resource_name = var.nsxt_resource_name
|
||||
|
||||
# Тип родительской услуги: "vdc" (нужен vdc_uid) или "vdcGroup" (нужен vdc_group_uid)
|
||||
vdc_type = var.nsxt_vdc_type
|
||||
|
||||
# refSvc-поле: принимает UUID или имя. Здесь берём UID созданного VDC,
|
||||
# чтобы Edge гарантированно создавался после vDC.
|
||||
vdc_uid = nubes_vc_vdc.vdc.id
|
||||
|
||||
need_enable_avi = var.nsxt_need_enable_avi
|
||||
virtual_services_count = var.nsxt_virtual_services_count
|
||||
|
||||
# routed-сеть, которую разворачивает Edge (SingleNestedAttribute -> объект)
|
||||
routed_net_configuration = {
|
||||
ip_addr_pool = var.nsxt_ip_addr_pool
|
||||
main_dns = var.nsxt_main_dns
|
||||
second_dns = var.nsxt_second_dns
|
||||
}
|
||||
}
|
||||
@@ -12,3 +12,18 @@ output "vdc_state_params" {
|
||||
description = "Параметры состояния VDC из API"
|
||||
value = nubes_vc_vdc.vdc.state_params
|
||||
}
|
||||
|
||||
output "nsxt_id" {
|
||||
description = "UID созданного Edge (vc_nsxt)"
|
||||
value = nubes_vc_nsxt.edge.id
|
||||
}
|
||||
|
||||
output "nsxt_name" {
|
||||
description = "Имя Edge (vc_nsxt)"
|
||||
value = nubes_vc_nsxt.edge.resource_name
|
||||
}
|
||||
|
||||
output "nsxt_state_params" {
|
||||
description = "Параметры состояния Edge (vc_nsxt) из API"
|
||||
value = nubes_vc_nsxt.edge.state_params
|
||||
}
|
||||
|
||||
@@ -54,6 +54,50 @@ variable "vdc_mem_allocated" {
|
||||
|
||||
variable "vdc_storage_config" {
|
||||
type = string
|
||||
default = "[{\"name\":\"fast\",\"size\":200}]"
|
||||
description = "Дисковое хранилище (JSON-массив, size в GB)"
|
||||
default = "[{\"name\":\"SATA\",\"size\":\"200\"}]"
|
||||
description = "Дисковое хранилище (JSON-массив, size в GB). Имя политики должно существовать в ресурсном пуле (например, SATA, SSD)"
|
||||
}
|
||||
|
||||
# --- vc_nsxt (Сетевой шлюз периметра / Edge) ---
|
||||
|
||||
variable "nsxt_resource_name" {
|
||||
type = string
|
||||
default = "fullpipe-edge"
|
||||
description = "Имя Edge (vc_nsxt)"
|
||||
}
|
||||
|
||||
variable "nsxt_vdc_type" {
|
||||
type = string
|
||||
default = "vdc"
|
||||
description = "Тип родительской услуги: vdc или vdcGroup"
|
||||
}
|
||||
|
||||
variable "nsxt_need_enable_avi" {
|
||||
type = bool
|
||||
default = false
|
||||
description = "Включить AVI Load Balancer"
|
||||
}
|
||||
|
||||
variable "nsxt_virtual_services_count" {
|
||||
type = number
|
||||
default = 1
|
||||
description = "Кол-во виртуальных сервисов, резервируемых на AVI (1..4)"
|
||||
}
|
||||
|
||||
variable "nsxt_ip_addr_pool" {
|
||||
type = string
|
||||
default = "10.10.102.0/24"
|
||||
description = "Адресный пул routed-сети (маска /24 обязательна)"
|
||||
}
|
||||
|
||||
variable "nsxt_main_dns" {
|
||||
type = string
|
||||
default = "81.22.46.22"
|
||||
description = "Основной DNS"
|
||||
}
|
||||
|
||||
variable "nsxt_second_dns" {
|
||||
type = string
|
||||
default = "185.247.187.77"
|
||||
description = "Второй DNS"
|
||||
}
|
||||
|
||||
@@ -15,4 +15,6 @@ resource "nubes_vc_vdc" "vdc" {
|
||||
storage_config = var.vdc_storage_config
|
||||
|
||||
suspend_on_destroy = true
|
||||
|
||||
adopt_existing_on_create = true
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ terraform {
|
||||
required_providers {
|
||||
nubes = {
|
||||
source = "tf-registry.containerk8s.services.ngcloud.ru/nubes-dev/nubes"
|
||||
version = "2.0.3"
|
||||
version = "2.0.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user