I’ve hit a feature of Cloudformation that is really tripping me up. I would like to pass in a certain variable to an event rule (code below) that is required to be a number, but cf converts everything into a string so I’m unable to do so. Anyone find a workaround for this?
“service”: {
“count”: [
{
“numeric”: [
“>”,
1 # this is the line that must be a number
]
}
]
}
this is the error i receive: Event pattern is not valid. Reason: Value of > must be numeric at
Unfortunately it will still be converted to a string. From aws documentation…
"Number
An integer or float. AWS CloudFormation validates the parameter value as a number; however, when you use the parameter elsewhere in your template (for example, by using the Ref
intrinsic function), the parameter value becomes a string."
You might not want to hear this. But, you might have to resort to a custom resource and just create it yourself with whichever language SDK you’re comfortable with.
Yeah that’s what I figured but I wanted to try to see if AWS had the support for it. Hopefully in a future update, but it’s frustrating to see it work in the documentation but when you try to use it you get unresolvable errors.