Numbers that need stringification fail for Tokens #3769
Labels
@aws-cdk/core
Related to core CDK functionality
feature-request
A feature should be added or improved.
As seen in #3758:
Sometimes CFN models properties as strings which are clearly intended to be numbers, and are modeled in CDK as numbers. If we immediately stringify these numbers in the constructor and the user happened to pass a Token, the template will end up containing something like
"-1.8881545897087673e+289"
.The solution is to stringify sometimes lazily, with a function like this:
This feature should probably live in the standard library, as many construct libraries are likely to need it.
An alternative approach would be spidering all strings for substrings that look like they might be stringified number Tokens, but this seems error-prone and expensive (computation-wise). For example, it would depend on the double stringification behavior of all JSII languages.
The text was updated successfully, but these errors were encountered: