forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cfn-include): correctly parse Fn::Sub expressions containing seri…
…alized JSON (aws#14512) Our logic for parsing `${}` expressions inside `Fn::Sub` incorrectly looked for closing braces everywhere in the string, instead of doing it to the right of the opening `${`. This would fail if the string passed to `Fn::Sub` was serialized JSON (as those would contain closing braces completely unrelated to the `${`). Fixes aws#14095 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
592d167
commit fa0ccdb
Showing
3 changed files
with
70 additions
and
10 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
packages/@aws-cdk/cloudformation-include/test/test-templates/yaml/json-in-fn-sub.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Parameters: | ||
Stage: | ||
Type: String | ||
Resources: | ||
Dashboard: | ||
Type: AWS::CloudWatch::Dashboard | ||
Properties: | ||
DashboardName: !Sub ${Stage}-Dashboard | ||
DashboardBody: !Sub | | ||
{ | ||
"widgets": [ | ||
{ | ||
"type": "text", | ||
"properties": { | ||
"markdown": "${Stage} ${Stage}" | ||
} | ||
}, | ||
{ | ||
"type": "text", | ||
"properties": { | ||
"markdown": "${Stage} ${Stage}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters