opentofu/terraform/test-fixtures/plan-prevent-destroy-count-bad/main.tf
Mitchell Hashimoto a332c121bc
terraform: prevent_destroy works for decreasing count
Fixes #5826

The `prevent_destroy` lifecycle configuration was not being checked when
the count was decreased for a resource with a count. It was only
checking when attributes changed on pre-existing resources.

This fixes that.
2016-10-28 21:31:47 -04:00

9 lines
123 B
HCL

resource "aws_instance" "foo" {
count = "1"
current = "${count.index}"
lifecycle {
prevent_destroy = true
}
}