Skip to content

Commit efe595d

Browse files
fix object check in input extraction
1 parent baa894f commit efe595d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pkg/tfbridge/schema.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333

3434
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
3535
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/schema"
36-
shimutil "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/util"
3736
)
3837

3938
// This file deals with translating between the Pulumi representations of a resource's configuration and state and the
@@ -1722,9 +1721,9 @@ func extractSchemaInputs(
17221721
return resource.NewArrayProperty(v)
17231722
case state.IsObject():
17241723
obj := state.ObjectValue()
1725-
if tfflds, ok := shimutil.CastToTypeObject(tfs); ok {
1724+
if tfflds, ok := tfs.Elem().(shim.Resource); ok {
17261725
return resource.NewProperty(
1727-
extractSchemaInputsObject(obj, tfflds, ps.Fields),
1726+
extractSchemaInputsObject(obj, tfflds.Schema(), ps.Fields),
17281727
)
17291728
}
17301729

@@ -1735,9 +1734,6 @@ func extractSchemaInputs(
17351734
etfs, eps := elemSchemas(tfs, ps)
17361735
for k, e := range obj {
17371736
input := extractSchemaInputs(e, etfs, eps)
1738-
if input.IsNull() && !etfs.Required() {
1739-
continue
1740-
}
17411737
v[k] = input
17421738
}
17431739

0 commit comments

Comments
 (0)