Terraform-常见函数:类型转化函数

时间:2023-11-01 16:16:29

类型转化函数

表4 类型转化函数

函数名称

函数描述

样例

运行结果

toset

将列表类型转换为集合类型

toset(["One", "Two", "One"])

["One", "Two"]

tolist

将集合类型转换为列表类型

tolist(["One", "Two", "Three"])

["One", "Two", "Three"]

tonumber

将字符串类型转换为数字类型

tonumber("33")

33

tostring

将数字类型转换为字符串类型

tostring(33)

"33"

support.huaweicloud.com/basics-terraform/terraform_0005.html