add an interp that fails during planned destroy

Chain some values so that we can get an interpolation that fails if a
module input is evaluated during destroy.
pull/23717/head
James Bardin 7 years ago
parent aa8a0f063c
commit 6bad4e3dc0

@ -10521,7 +10521,6 @@ func TestContext2Apply_plannedDestroyInterpolatedCount(t *testing.T) {
}
ctxOpts.ProviderResolver = providerResolver
ctxOpts.Destroy = true
ctx, diags = NewContext(ctxOpts)
if diags.HasErrors() {
t.Fatalf("err: %s", diags.Err())

@ -3,9 +3,18 @@ variable "list" {
}
resource "aws_instance" "a" {
count = "${length(var.list)}"
count = length(var.list)
}
locals {
ids = aws_instance.a[*].id
}
module "empty" {
source = "./mod"
input = zipmap(var.list, local.ids)
}
output "out" {
value = "${aws_instance.a.*.id}"
value = aws_instance.a[*].id
}

Loading…
Cancel
Save