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.
This commit is contained in:
parent
aa8a0f063c
commit
6bad4e3dc0
|
@ -10521,7 +10521,6 @@ func TestContext2Apply_plannedDestroyInterpolatedCount(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ctxOpts.ProviderResolver = providerResolver
|
ctxOpts.ProviderResolver = providerResolver
|
||||||
ctxOpts.Destroy = true
|
|
||||||
ctx, diags = NewContext(ctxOpts)
|
ctx, diags = NewContext(ctxOpts)
|
||||||
if diags.HasErrors() {
|
if diags.HasErrors() {
|
||||||
t.Fatalf("err: %s", diags.Err())
|
t.Fatalf("err: %s", diags.Err())
|
||||||
|
|
|
@ -3,9 +3,18 @@ variable "list" {
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_instance" "a" {
|
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" {
|
output "out" {
|
||||||
value = "${aws_instance.a.*.id}"
|
value = aws_instance.a[*].id
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
variable "input" {
|
||||||
|
}
|
Loading…
Reference in New Issue