@@ -351,7 +351,6 @@ func (ctx *conversionContext) makeTerraformInput(
351351 old , v resource.PropertyValue ,
352352 tfs shim.Schema ,
353353 ps * SchemaInfo ,
354- rawNames bool ,
355354) (interface {}, error ) {
356355 // For TypeList or TypeSet with MaxItems==1, we will have projected as a scalar
357356 // nested value, and need to wrap it into a single-element array before passing to
@@ -435,7 +434,7 @@ func (ctx *conversionContext) makeTerraformInput(
435434 oldElem = oldArr [i ]
436435 }
437436 elemName := fmt .Sprintf ("%v[%v]" , name , i )
438- e , err := ctx .makeTerraformInput (elemName , oldElem , elem , etfs , eps , rawNames )
437+ e , err := ctx .makeTerraformInput (elemName , oldElem , elem , etfs , eps )
439438 if err != nil {
440439 return nil , err
441440 }
@@ -554,15 +553,7 @@ func (ctx *conversionContext) makeMapTerraformInputs(
554553 old = olds [key ]
555554 }
556555
557- // If type information is lost (the map's element type is unknown), subsequent
558- // nested PropertyMap values will be treated by makeObjectTerraformInputs. In this
559- // case rawNames=true needs to make sure makeObjectTerraformInputs does not mangle
560- // pulumiStyleLabels into terraform_style_labels. This is the legacy behavior
561- // enforced by tests. It also makes intuitive sense: absent schema information the
562- // code should not be doing name mangling.
563- rawNames := tfsElement == nil
564-
565- v , err := ctx .makeTerraformInput (name , old , value , tfsElement , psElement , rawNames )
556+ v , err := ctx .makeTerraformInput (name , old , value , tfsElement , psElement )
566557 if err != nil {
567558 return nil , err
568559 }
@@ -626,7 +617,7 @@ func (ctx *conversionContext) makeObjectTerraformInputs(
626617 }
627618
628619 // And then translate the property value.
629- v , err := ctx .makeTerraformInput (name , old , value , tfi , psi , false )
620+ v , err := ctx .makeTerraformInput (name , old , value , tfi , psi )
630621 if err != nil {
631622 return nil , err
632623 }
@@ -769,7 +760,7 @@ func (ctx *conversionContext) applyDefaults(
769760
770761 if old , hasold := olds [key ]; hasold && useOldDefault (key ) {
771762 v , err := ctx .makeTerraformInput (name , resource.PropertyValue {},
772- old , tfi , psi , rawNames )
763+ old , tfi , psi )
773764 if err != nil {
774765 return err
775766 }
@@ -811,15 +802,15 @@ func (ctx *conversionContext) applyDefaults(
811802 defaultValue , source = v , "env vars"
812803 } else if configKey := info .Default .Config ; configKey != "" {
813804 if v := ctx .ProviderConfig [resource .PropertyKey (configKey )]; ! v .IsNull () {
814- tv , err := ctx .makeTerraformInput (name , resource.PropertyValue {}, v , tfi , psi , rawNames )
805+ tv , err := ctx .makeTerraformInput (name , resource.PropertyValue {}, v , tfi , psi )
815806 if err != nil {
816807 return err
817808 }
818809 defaultValue , source = tv , "config"
819810 }
820811 } else if info .Default .Value != nil {
821812 v := resource .NewPropertyValue (info .Default .Value )
822- tv , err := ctx .makeTerraformInput (name , resource.PropertyValue {}, v , tfi , psi , rawNames )
813+ tv , err := ctx .makeTerraformInput (name , resource.PropertyValue {}, v , tfi , psi )
823814 if err != nil {
824815 return err
825816 }
@@ -921,7 +912,7 @@ func (ctx *conversionContext) applyDefaults(
921912 key , tfi , psi := getInfoFromTerraformName (name , tfs , ps , rawNames )
922913
923914 if old , hasold := olds [key ]; hasold && useOldDefault (key ) {
924- v , err := ctx .makeTerraformInput (name , resource.PropertyValue {}, old , tfi , psi , rawNames )
915+ v , err := ctx .makeTerraformInput (name , resource.PropertyValue {}, old , tfi , psi )
925916 if err != nil {
926917 valueErr = err
927918 return false
0 commit comments