Skip to content

Commit

Permalink
feat(intrinsics): Allow for int in Fn::Equals (awslabs#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrn authored Feb 3, 2021
1 parent 4dae9f5 commit dd6cd2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cloudformation/intrinsics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd6cd2d

Please sign in to comment.