-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
creationPolicy type does not support Tokens #1453
Comments
@mipearson See #1455 - that's probably a better way to support this. The reason we are trying to avoid union types in the APIs is because they can hardly be translated well to other programming languages. |
I don't follow - there's lots of bits in the code/types where the type is Or does that string/Token union type get magically translated to something Java/C# compatible by jsii? |
(background: I've written a tool to convert a JSON CFN stack to CDK CFN primitives. It nearly works, except for this edge case. Goal is to make it easier for people to convert existing stacks to CDK as they can take the working CDK output and tidy it up / turn it into constructs) |
@mipearson only our lower level CFN resources/props use tokens for property types that use primitive values, and those are going away soon as well since now we have a way to represent those tokens using native types (string/string[] and hopefully number soon). |
Excellent. I was actually going to close this - I worked out I can work around it by using |
I want to point out here that what I was trying to do was based on a lack of understanding of how CDK works, as this issues is referenced as a use case from another. These values are no longer references in my stack: they're available at compile / synth time. |
Trying to convert the following to CDK-flavoured L2 constructs:
However, the CDK types do not seem to support using anything other than a number. The following fails typescript compilation:
The
resourceSignal
type only acceptsnumber
andundefined
forcount
, meaning I can't "cheat" and use a stringified nor a raw token.Note that this is using CDK in its context as a "way to write cloudformation templates" rather than the entire app, so parameters / outputs / conditionals are being used.
The text was updated successfully, but these errors were encountered: