github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/cloudformation/parser/fn_condition.go (about) 1 package parser 2 3 func ResolveCondition(property *Property) (resolved *Property, success bool) { 4 if !property.isFunction() { 5 return property, true 6 } 7 8 refProp := property.AsMap()["Condition"] 9 if refProp.IsNotString() { 10 return nil, false 11 } 12 refValue := refProp.AsString() 13 14 for k, prop := range property.ctx.Conditions { 15 if k == refValue { 16 return prop.resolveValue() 17 } 18 } 19 20 return nil, false 21 }