Skip to content
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

fix(cfn-include): Fn::FindInMap cannot be used for boolean properties #11323

Merged
merged 3 commits into from
Nov 6, 2020

Conversation

skinny85
Copy link
Contributor

@skinny85 skinny85 commented Nov 5, 2020

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

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
@skinny85 skinny85 requested a review from rix0rrr November 5, 2020 19:40
@gitpod-io
Copy link

gitpod-io bot commented Nov 5, 2020

@skinny85 skinny85 self-assigned this Nov 5, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 5, 2020
@mergify
Copy link
Contributor

mergify bot commented Nov 6, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: f6be7c2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 47b698e into aws:master Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cloudformation_include] Error while parsing json Cloudformation
3 participants