iac_modules/terraform-hcl-standard/vultr-vps/templates/variables.tf
Haitao Pan 3a8065e6f0 refactor(vultr-vps): split declaration / shared templates / shared scripts
- config/resources/ai-workspace-hosts.yaml: resource declaration (moved from env)
- templates/: shared provider.tf, variables.tf, cloud-init.yaml + hosts.tf.j2,
  inventory.ini.j2 (render copies the .tf/config into the env workdir)
- scripts/generate.py + provision.sh: shared composition logic, parameterized
  by --resources/--workdir (no longer duplicated per env)
- envs/ai-workspace/: degraded to a terraform workdir (only README/.gitignore
  tracked; rendered artifacts + tfstate gitignored)
- AGENTS.md + terraform-yaml-render-pattern skill updated to the layered layout

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:21:45 +08:00

26 lines
939 B
HCL
Raw 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.

# 全局变量。值由 generate.py 从 hosts.yaml 的 global 段渲染进
# terraform.auto.tfvars.json 后传入(即 “YAML 描述资源信息 -> variables.tf”
# 逐主机的资源不走变量,而是由 generate.py 用 Jinja2 渲染成 generated_hosts.tf
# 里的显式 module/resource 块(不使用 for_each/count 等 HCL 控制结构)。
#
# 注意vultr_api_key 变量与 provider 配置由 ../../templates/provider.tf 提供,
# generate.py render 时会把它拷入本目录;故此处不再重复声明该变量。
variable "region" {
description = "默认部署区域,主机未单独指定 region 时使用"
type = string
default = "nrt"
}
variable "name_prefix" {
description = "实例 label 前缀"
type = string
default = "ai-workspace"
}
variable "user_data_file" {
description = "cloud-init 脚本路径"
type = string
default = "cloud-init.yaml"
}