variable是Terraform重要的配置文件类型之一,通过对变量的集中管理,用户可以在资源文件中直接引用变量名进行赋值。首先需要先定义(声明)变量,放到一个.tf文件中,如: 创建variable.tf文件,配置参数的默认值 variable "access_key" {}variable "secret_key" {}variable "region" { default = "us-east-1"}variable "...
# Instance types variables variable "cpu_core_count" { description = "CPU core count is used to fetch instance types." default = 2 } variable "memory_size" { description = "Memory size used to fetch instance types." default = 4 } # VPC variables variable "vpc_name" { description = ...
In variable definitions (.tfvars) files, either specified on the command line or automatically loaded. -var-file= As environment variables. TF_VAR_xxx 优先级 (由低到高): Environment variables The terraform.tfvars file, if present. The terraform.tfvars.json file, if present. Any .auto.tfvars...
variable是Terraform重要的配置文件类型之一,通过对变量的集中管理,用户可以在资源文件中直接引用变量名进行赋值。首先需要先定义(声明)变量,放到一个.tf文件中,如: 创建文件,配置参数的默认值 variable "access_key" {}variable "secret_key" {}variable "region" { default = "us-east-1"}variable "f5user" {...
variable"vm_ip"{description ="Ip used for the vSpgere virtual machine"}variable"vm_netmask"{description ="Netmask used for the vSphere virtual machine (example: 24)"}variable"vm_gateway"{description ="Gateway for the vSphere virtual machine"}variable"vm_dns"{description ="DNS for the vSphere...
variable "secret_key" {} # 设置腾讯云提供者 provider "tencentcloud" { secret_id =var.secret_id secret_key = var.secret_key region = var.region } 注意:region这里为修改成了重庆,因为我重庆没有资源,想区分一下! 创建VPC这里还好,看一下腾讯云控制台: ...
variable "main-region" { type = string } output.tf vpc子模块输出变量,vpc子模块创建成功后,可以读取vpc相关信息,供上层或其他模块调用时读取 output "vpc_id" { description = "The ID of the VPC" value = module.vpc.vpc_id } output "vpc_arn" { ...
variable "accept_ip"{ description="Use EnvVar: $TF_VAR_accept_ip instead" } resource "tencentcloud_vpc""vpc"{ name="eks-vpc" cidr_block="10.2.0.0/16" } resource "tencentcloud_subnet""sub"{ vpc_id=tencentcloud_vpc.vpc.id ...
terraform { required_providers { tencentcloud = { source = "tencentcloudstack/tencentcloud" version = "1.81.25" } } } variable "region" { description = "腾讯云地域" type = string default = "ap-chongqing" } variable "secret_id" {} variable "secret_key" {} # 设置腾讯云提供者 provider "...
variable "worker_instance_types" { description = "The ecs instance types used to launch worker nodes." default = ["ecs.g6.2xlarge", "ecs.g6.xlarge"] } # 设置工作节点的密码 variable "password" { description = "The password of ECS instance." default = "Test123456"...