diff --git a/pkg/tfbridge/schema.go b/pkg/tfbridge/schema.go index 0314ecc863..759d01d4fd 100644 --- a/pkg/tfbridge/schema.go +++ b/pkg/tfbridge/schema.go @@ -365,6 +365,12 @@ func (ctx *conversionContext) MakeTerraformInput(name string, old, v resource.Pr case v.IsNull(): return nil, nil case v.IsBool(): + if tfs != nil && tfs.Type() == shim.TypeString { + if v.BoolValue() { + return "true", nil + } + return "false", nil + } return v.BoolValue(), nil case v.IsNumber(): if tfs != nil && tfs.Type() == shim.TypeFloat { @@ -718,7 +724,12 @@ func (ctx *conversionContext) applyDefaults(result map[string]interface{}, olds, } if defaultValue != nil { glog.V(9).Infof("Created Terraform input: %v = %v (from %s)", name, defaultValue, source) - result[name] = defaultValue + pValue := resource.NewPropertyValue(defaultValue) + tv, err := ctx.MakeTerraformInput(name, resource.PropertyValue{}, pValue, tfi, psi, rawNames) + if err != nil { + return err + } + result[name] = tv newDefaults = append(newDefaults, key) // Expand the conflicts and exactlyOneOf map