From 411f34c926718edeaa54542b789b9216955ded2d Mon Sep 17 00:00:00 2001 From: Owen Rumney Date: Thu, 11 Nov 2021 14:58:13 +0000 Subject: [PATCH] Fix issue with panic on function not resolving (#20) --- internal/app/cfsec/parser/intrinsics.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/app/cfsec/parser/intrinsics.go b/internal/app/cfsec/parser/intrinsics.go index 34f1d212..f4a20d88 100644 --- a/internal/app/cfsec/parser/intrinsics.go +++ b/internal/app/cfsec/parser/intrinsics.go @@ -12,23 +12,24 @@ var intrinsicFuncs map[string]func(property *Property) (*Property, bool) func init() { intrinsicFuncs = map[string]func(property *Property) (*Property, bool){ - "Ref": ResolveReference, - "Fn::Base64": ResolveBase64, - "Fn::Equals": ResolveEquals, - "Fn::Join": ResolveJoin, - "Fn::Split": ResolveSplit, - "Fn::Sub": ResolveSub, - "Fn::FindInMap": ResolveFindInMap, - "Fn::Select": ResolveSelect, - "Fn::GetAtt": ResolveGetAtt, - "Fn::GetAZs": GetAzs, - "Fn::Cidr": GetCidr, + "Ref": ResolveReference, + "Fn::Base64": ResolveBase64, + "Fn::Equals": ResolveEquals, + "Fn::Join": ResolveJoin, + "Fn::Split": ResolveSplit, + "Fn::Sub": ResolveSub, + "Fn::FindInMap": ResolveFindInMap, + "Fn::Select": ResolveSelect, + "Fn::GetAtt": ResolveGetAtt, + "Fn::GetAZs": GetAzs, + "Fn::Cidr": GetCidr, + "Fn::ImportValue": PassthroughResolution, // "Fn::If": PassthroughResolution, } } func PassthroughResolution(property *Property) (*Property, bool) { - return property, true + return property, false } func IsIntrinsicFunc(node *yaml.Node) bool {