Terraform支持许多类型约束,包括string、number、bool、list、map、set、object、tuple和any。如果未指定类型,那么Terraform会设置默认约束类型为any。 还可以使用类型约束创建更复杂的对象和元组结构类型。 也可以通过环境变量来设置输入变量初始值。命名规范是TF_VAR_,其中是你要设置的输入变量的名称。 如果不想在每次运...
file读取指定路径下的文件内容,并将其作为 string 返回。 > file("${path.module}/hello.txt") Hello World jsondecode函数 jsondecode将一个给定的 string 解释为 JSON,返回该字符串的解码结果。 该函数以如下方式将 JSON 值映射到Terraform 语言 type: Terraform 语言的自动类型转换规则意味着你通常不需要担心一...
Terraform 数据类型分为 原始类型(string、number、bool) 与 复杂类型(list()、map()、set()、object、tuple),支持自定义输入变量variable、本地变量locals、输出变量output,以块的型式组织成.tf文件。 HCL是一个用于创建结构化配置语言的工具包,主要针对DevOps工具、服务器等。 HCL既有一种原生语法,旨在让人类愉快...
基本类型:string、number、bool 复合类型:list(<TYPE>)、set(<TYPE>)、map(<TYPE>)、object({<ATTR NAME> = <TYPE>, ... })、tuple([<TYPE>, ...]) 描述 简要描述每个变量的用途。例如: variable"image_id"{ type=string description="The id of the machine image (AMI) to use for the server...
包含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"} ...
Elements of list/tuple and map/object values can be accessed using the square-bracket index notation, likelocal.list[3]. The expression within the brackets must be a whole number for list and tuple values or a string for map and object values. ...
包含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" ...
jsondecode将一个给定的 string 解释为 JSON,返回该字符串的解码结果。 该函数以如下方式将 JSON 值映射到Terraform 语言 type: Terraform 语言的自动类型转换规则意味着你通常不需要担心一个给定的值到底会产生什么类型,只需以直观的方式使用结果即可。
For a map or object type, like above, theksymbol refers to the key or attribute name of the current element. You can also use the two-symbol form with lists and tuples, in which case the additional symbol is the index of each element starting from zero, which conventionally has the sy...
": 19: subnet_ids = concat(data.aws_subnet_ids.private.ids, data.aws_subnet_ids.public.ids) |--- | data.aws_subnet_ids.private.ids is set of string with 3 elements Invalid value for "seqs" parameter: all arguments must be lists or tuples; got set of string. 是Bug还是我漏掉了...