From dd6cd2d943eca6b4b0118066665a850ad0f2cc50 Mon Sep 17 00:00:00 2001 From: Marcin Rabenda Date: Wed, 3 Feb 2021 13:48:17 +0100 Subject: [PATCH] feat(intrinsics): Allow for int in Fn::Equals (#346) --- cloudformation/intrinsics.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cloudformation/intrinsics.go b/cloudformation/intrinsics.go index f95ce3a426..0f7a6f6b42 100644 --- a/cloudformation/intrinsics.go +++ b/cloudformation/intrinsics.go @@ -159,7 +159,12 @@ func Split(delimiter, source interface{}) string { // Equals compares if two values are equal. Returns true if the two values are equal or false if they aren't. func Equals(value1, value2 interface{}) string { - return encode(fmt.Sprintf(`{ "Fn::Equals" : [ %q, %q ] }`, value1, value2)) + switch value2.(type) { + case int: + return encode(fmt.Sprintf(`{ "Fn::Equals" : [ %q, %v ] }`, value1, value2)) + default: + return encode(fmt.Sprintf(`{ "Fn::Equals" : [ %q, %q ] }`, value1, value2)) + } } // (str, str, str) -> str