File tree 1 file changed +8
-2
lines changed
src/cfnlint/template/transforms
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 14
14
import regex as re
15
15
16
16
from cfnlint .conditions ._utils import get_hash
17
+ from cfnlint .decode .node import str_node
17
18
from cfnlint .helpers import FUNCTION_FOR_EACH
18
19
from cfnlint .template .transforms ._types import TransformResult
19
20
@@ -197,10 +198,15 @@ def _replace_string_params(
197
198
pattern = r"\${[a-zA-Z0-9\.:]+}"
198
199
if not re .search (pattern , s ):
199
200
return (True , s )
201
+
202
+ new_s = deepcopy (s )
200
203
for k , v in params .items ():
201
- s = re .sub (rf"\$\{{{ k } \}}" , v , s )
204
+ new_s = re .sub (rf"\$\{{{ k } \}}" , v , new_s )
205
+
206
+ if isinstance (s , str_node ):
207
+ new_s = str_node (new_s , s .start_mark , s .end_mark )
202
208
203
- return (not (bool (re .search (pattern , s ))), s )
209
+ return (not (bool (re .search (pattern , new_s ))), new_s )
204
210
205
211
206
212
class _ForEachValue :
You can’t perform that action at this time.
0 commit comments