resource "hauweicloud_vpc" "vpc" { for_each = { vpc_demo1 = "192.168.0.0/16" vpc_demo2 = "172.16.0.0/16" } name = each.key cidr = each.value } 在使用字符串集合类型表达时,"each.key" 等同于 "each.value",我们一般使用 each.key表示,另外
当objet A和object B都引用自相同的底层数据时,只要你操作object A,就会修改到object B。在 while...
Terraform’sfor_eachrequires amapor aset of strings. Convert theflattenedlist to a map. for_each={for values in local.vnet_subnet :"${values.virtual_network_name}.${values.subnet_name}"=> values} Resulting Map: {"vnet1.subnet1"={virtual_network_name="vnet1",subnet_name="subnet1",addr...
For example, ifvar.listwere a list of strings, then the following expression would produce a tuple of strings with all-uppercase letters: [forsinvar.list:upper(s)] Thisforexpression iterates over each element ofvar.list, and then evaluates the expressionupper(s)withsset to each respective ...
那么kubernetes_manifest.secret资源中的lambda/闭包作用域迭代器变量(默认名称为each)将是一个list(...
defaults.regex_replace_chars) # string_label_names are names of inputs that are strings (not list of strings) used as labels string_label_names = ["namespace", "tenant", "environment", "stage", "name"] normalized_labels = { for k in local.string_label_names : k => local.input[k...
{ description = "List of existing vswitch id." type = list(string) default = [] } variable "vswitch_cidrs" { description = "List of cidr blocks used to create several new vswitches when 'vswitch_ids' is not specified." type = list(string) default = ["10.1.2.0/24"] } variable "...
那么kubernetes_manifest.secret资源中的lambda/闭包作用域迭代器变量(默认名称为each)将是一个list(...
nodepools - A list of Nodepool Entries. Each element contains the following attributes: auto_renew - Whether to enable automatic renewal for nodes in the node pool takes effect only when instance_charge_type is set to PrePaid. Default value: false. Valid values:- true: Automatic renewal. -...
Each input variable accepted by a module must be declared using avariableblock: variable"image_id"{type=string}variable"availability_zone_names"{type=list(string)default=["us-west-1a"]}variable"docker_ports"{type=list(object({internal=numberexternal=numberprotocol=string}))default=[{internal=8300...