我有一个要循环创建资源的列表:
variable "mylist" {
description = "my list"
default = ["a","b","c"]
}
resource "aws_instance" "sdfsdfd" {
count = length(var.mylist)
tags = element(var.bommie_computer_name, count.index)
如果数组的顺序发生变化,如何使terraform不会破坏资源?我希望能够将["a","b","c"]
更改为["c","b","a"]
,并使其terraform不破坏和重新创建任何东西。我必须使用for_each来获得此行为吗?