From e09b67bebdd5df514e78c451449c1fc3a8ddd57f Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 13 Jan 2023 13:20:25 -0500 Subject: [PATCH] simplify output assignment --- internal/builtin/providers/terraform/resource_data.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/builtin/providers/terraform/resource_data.go b/internal/builtin/providers/terraform/resource_data.go index 91a2a68794..eb39f3ed66 100644 --- a/internal/builtin/providers/terraform/resource_data.go +++ b/internal/builtin/providers/terraform/resource_data.go @@ -76,7 +76,7 @@ func planDataStoreResourceChange(req providers.PlanResourceChangeRequest) (resp // Output type must always match the input, even when it's null. if input.IsNull() { - planned["output"] = cty.NullVal(input.Type()) + planned["output"] = input } else { planned["output"] = cty.UnknownVal(input.Type()) } @@ -92,7 +92,7 @@ func planDataStoreResourceChange(req providers.PlanResourceChangeRequest) (resp // We need to check the input for the replacement instance to compute a // new output. if input.IsNull() { - planned["output"] = cty.NullVal(input.Type()) + planned["output"] = input } else { planned["output"] = cty.UnknownVal(input.Type()) }