diff --git a/pkg/types/field.go b/pkg/types/field.go index e7b9c143..b4f04866 100644 --- a/pkg/types/field.go +++ b/pkg/types/field.go @@ -268,12 +268,12 @@ func NewSensitiveField(g *Builder, cfg *config.Resource, r *resource, sch *schem return nil, true, nil } sfx := "SecretRef" - switch f.FieldType.String() { - case "string", "*string", "map[string]string", "map[string]*string": - cfg.Sensitive.AddFieldPath(fieldPathWithWildcard(f.TerraformPaths), "spec.forProvider."+fieldPathWithWildcard(f.CRDPaths)+sfx) - case "[]string", "[]*string": + switch f.FieldType.(type) { + case *types.Slice: f.CRDPaths[len(f.CRDPaths)-2] = f.CRDPaths[len(f.CRDPaths)-2] + sfx cfg.Sensitive.AddFieldPath(fieldPathWithWildcard(f.TerraformPaths), "spec.forProvider."+fieldPathWithWildcard(f.CRDPaths)) + default: + cfg.Sensitive.AddFieldPath(fieldPathWithWildcard(f.TerraformPaths), "spec.forProvider."+fieldPathWithWildcard(f.CRDPaths)+sfx) } // todo(turkenh): do we need to support other field types as sensitive? if f.FieldType.String() != "string" && f.FieldType.String() != "*string" && f.FieldType.String() != "[]string" &&