Skip to content

Commit 24a515d

Browse files
authored
Update W3037 to skip non strings (#4023)
1 parent 0bf508f commit 24a515d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/cfnlint/rules/resources/iam/Permissions.py

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def validate(
4040
actions = ensure_list(instance)
4141

4242
for action in actions:
43+
if not validator.is_type(action, "string"):
44+
continue
4345
if action == "*":
4446
continue
4547
if ":" not in action:

test/unit/rules/resources/iam/test_iam_permissions.py

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def rule():
3030
("Invalid string with starting astrisk", "s3:*Foo", 1),
3131
("Invalid service", "foo:Bar", 1),
3232
("Empty string", "", 1),
33+
("A function", {"Ref": "MyParameter"}, 0),
3334
],
3435
)
3536
def test_permissions(name, instance, err_count, rule, validator):

0 commit comments

Comments
 (0)