mirror of https://github.com/hashicorp/terraform
When computing the count value, make sure to include walkDestroy with
walkApply, as the former is only a special case of the latter.
When applying a saved plan, the computed count values are lost and we
can no longer query the state for those values. The apply walk was
already considered in the `resourceCountMax` function, but the destroy
walk was not. This worked when destroying in a single operation
("terraform destroy"), since the state would still be updated with the
latest counts from the plan.
pull/17824/head
parent
be6fffb171
commit
cfefeec926
@ -0,0 +1,11 @@
|
||||
variable "list" {
|
||||
default = ["1", "2"]
|
||||
}
|
||||
|
||||
resource "aws_instance" "a" {
|
||||
count = "${length(var.list)}"
|
||||
}
|
||||
|
||||
output "out" {
|
||||
value = "${aws_instance.a.*.id}"
|
||||
}
|
||||
Loading…
Reference in new issue