输入变量块中通过 type 定义类型: 基本类型:string、number、bool 复合类型:list(<TYPE>)、set(<TYPE>)、map(<TYPE>)、object({<ATTR NAME> = <TYPE>, ... })、tuple([<TYPE>, ...]) 描述 简要描述每个变量的用途。例如: variable"image_id"{ type=string
包含string、number、bool、list、map、set、object、tuple、any(默认约束类型为any) string# 字符串 variable"map_example"{ description ="an example of a map in terrform"type=map(string)default= { key1 ="value1"key2 ="value2"key3 ="value3"} } number# 数字 variable"number_example"{ descript...
variables.tf 里一般会写上变量的声明,例如这里需要声明腾讯云的 secret id 和 secret key 变量。 variable"tencentcloud_secret_id"{type=stringdescription="Set Tencent Cloud secret id."sensitive=truenullable=false}variable"tencentcloud_secret_key"{type=stringdescription="Set Tencent Cloud secret key."sensitiv...
以管理员身份打开PowerShell,输入Get-ExecutionPolicy,返回Bypass则代表目前执行的是绕过策略来安装。如果返回的是Restricted受限制的,则需要运行Set-ExecutionPolicy AllSigned 或者 Set-ExecutionPolicy Bypass -Scope Process。 既然是Restricted受限制的,复制下面这条命令即可安装完成,这里没有太多坑。Set-ExecutionPolicy Bypass...
复合类型:list(<TYPE>),set(<TYPE>),map(<TYPE>) 复合类型的变量定义如下: variable"availability_zone_names"{type=list(string)default= ["cn-north-1a"] } variable"docker_ports"{type=list(object({ internal =numberexternal =numberprotocol =string}))default= [{ ...
变量的使用都是使用variable关键字,后面跟上变量的名称,块里面有变量的类型。 只需要将模块当中经常变化的部分声明为变量,类似于shell。 这些变量也可以跨不同的模块去共享,比如像region信息,当我们有多个模块的时候,既然在同一个region下面,我们就不需要声明很多这种变量了,这样可以实现组合和重用。
type = bool default = true } variable "dolphindb_lic_content" { type = string } variable "cluster_nodes" { type = string } variable "cluster_cfg" { type = string } variable "controller_cfg_p1" { type = string } variable "agent_cfg_p1" { type = string } # P2 P3 相关内容已省略...
variable"region"{ default ="cn-shanghai"}variable"instance_type"{ type = string default ="ecs.e-c1m1.large"}variable"vpc_cidr_block"{ default ="172.16.0.0/16"}variable"vsw_cidr_block"{ default ="172.16.0.0/24"}# 官网demo地址variable"war_url"{ type = string default ="http://edas-...
variable"region"{type = stringdescription ="region name"default ="cn-beijing"sensitive = true} Variable参数类型 any string number bool list() set() map() object([ATTR_NAME = ATTR_TYPE, ...) tuple([, ...]) VariableMap 示例:使用map类型的变量来定义DNS域名 ...
type = string default = "ap-shanghai" } variable "secret_id" {} variable "secret_key" {} # 设置腾讯云提供者 provider "tencentcloud" { secret_id =var.secret_id secret_key = var.secret_key region = var.region } data "tencentcloud_availability_zones" "availability_zones" {} ...