Skip to content

Commit aff40ec

Browse files
authored
Return all values as a string (#3508)
1 parent a1d4c7c commit aff40ec

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/cfnlint/jsonschema/_resolvers_cfn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _replace(matchobj):
246246
ref_values=c.ref_values,
247247
)
248248
)
249-
return value
249+
return str(value)
250250
raise ValueError(f"No matches for {matchobj.group(2)!r}")
251251

252252
try:

test/unit/rules/functions/test_sub.py

+6
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ def context(cfn):
156156
{"type": "string"},
157157
[],
158158
),
159+
(
160+
"Valid Fn::Sub with an integer parameter",
161+
{"Fn::Sub": ["${Foo}", {"Foo": 1}]},
162+
{"type": "string"},
163+
[],
164+
),
159165
(
160166
"Invalid Fn::Sub with a too to many elements",
161167
{"Fn::Sub": ["${foo}", {"foo": "bar"}, {}]},

0 commit comments

Comments
 (0)