-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[cloudformation_include] Error while parsing json Cloudformation #11300
Comments
Thanks for opening the issue @rrezino . Confirming I was able to reproduce it. Working on a fix. |
While I work on releasing a fix, you can actually unblock yourself with a small trick. The problem is the {
"Resources": {
"DBInstance": {
"Properties": {
"MultiAZ": {
"Fn::Not": [
{
"Fn::Not": [
{
"Fn::FindInMap": [
"Environment",
{ "Ref": "Environment" },
"MultiAZ"
]
}
]
}
]
},
// ... It doesn't change the meaning of the template, but allows it to be correctly included. |
Including a template that was using an Fn::FindInMap expression for a boolean-typed property would fail with an error similar to: "Expected 'true' or 'false' for boolean value, got: '${Token[TOKEN.151]}'". The reason is that our Fn.findInMap() function in core incorrectly assumes Fn::FindInMap can only return string values. Change CfnParser to use a new, module-private function Fn._findInMap() that returns an IResolvable. Fixes aws#11300
…#11323) Including a template that was using an `Fn::FindInMap` expression for a boolean-typed property would fail with an error similar to: `Expected 'true' or 'false' for boolean value, got: '${Token[TOKEN.151]}'`. The reason is that our `Fn.findInMap()` function in `core` incorrectly assumes `Fn::FindInMap` can only return string values. Change `CfnParser` to use a new, module-private function `Fn._findInMap()` that returns an `IResolvable`. Fixes #11300 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Thanks Adam! |
No problem, thanks for reporting the issue! |
I'm trying to follow the instructions here on how to create CDK code from existing Stacks. With the example case, it works fine, but when I try one real stack it fails. Probably a situation not covered on Json, but, I don't know what part is failing.
Reproduction Steps
What did you expect to happen?
Get the CDK version of an existing Stack.
What actually happened?
jsii.errors.JSIIError: Expected 'true' or 'false' for boolean value, got: '${Token[TOKEN.151]}'
Subprocess exited with error 1
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: