terraform build in function 内置函数 2020/09/14 | 运维 | Zhiming Zhang | 暂无评论 | 1470 views terraform 常用内置函数 basename(“/home/abc/file.txt “) ==> file.txt 这个会返回路径的最后的文件名 coalesce(“”,””,”hello”) ==> hell……
terraform conditionals 2020/09/14 | 运维 | Zhiming Zhang | 暂无评论 | 882 views terrafrom在使用的时候需要有需要判断来赋值,例如: Default resource “aws_instance” "myinstawnce"{ count = "${var.env =='prod'?2:1 }" } 1234 resource “aws_instance” "myinstawnce"{ count = "${var.env =='prod'?2:1 }"} 就是根据env来确定需要几台机器,如果是prod , 就是2 ,如果不是,就是1