github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/cloudformation/parser/fn_length.go (about) 1 package parser 2 3 import "github.com/khulnasoft-lab/defsec/pkg/scanners/cloudformation/cftypes" 4 5 func ResolveLength(property *Property) (*Property, bool) { 6 if !property.isFunction() { 7 return property, true 8 } 9 10 val := property.AsMap()["Fn::Length"] 11 if val.IsList() { 12 return property.deriveResolved(cftypes.Int, val.Len()), true 13 } else if val.IsMap() { 14 resolved, _ := val.resolveValue() 15 16 if resolved.IsList() { 17 return property.deriveResolved(cftypes.Int, resolved.Len()), true 18 } 19 return resolved, false 20 } 21 22 return property, false 23 24 }