diff --git a/src/cfnlint/rules/functions/_BaseFn.py b/src/cfnlint/rules/functions/_BaseFn.py index 2e4e118997..99dce4adf4 100644 --- a/src/cfnlint/rules/functions/_BaseFn.py +++ b/src/cfnlint/rules/functions/_BaseFn.py @@ -63,6 +63,11 @@ def resolve( key, _ = self.key_value(instance) return_err: ValidationError | None = None + validator = validator.evolve( + context=validator.context.evolve( + strict_types=False, + ), + ) for value, v, resolve_err in validator.resolve_value(instance): if resolve_err: yield resolve_err diff --git a/test/unit/rules/functions/test_basefn.py b/test/unit/rules/functions/test_basefn.py index a4dc9dabf3..3cfbdc4783 100644 --- a/test/unit/rules/functions/test_basefn.py +++ b/test/unit/rules/functions/test_basefn.py @@ -27,6 +27,12 @@ def rule(): [], ), ("Everything is fine", {"Fn::Sub": "Foo"}, {"enum": ["Foo"]}, []), + ( + "Resolved Fn::Sub has no strict type validation", + {"Fn::Sub": "2"}, + {"type": ["integer"]}, + [], + ), ( "Standard error", {"Fn::Sub": "Bar"},