Skip to content

Commit 4c969de

Browse files
authored
Update I3510 to not fail on resources that start with asterisk (#4029)
1 parent 60a0978 commit 4c969de

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __eq__(self, value: Any):
6464
):
6565
if x == y:
6666
continue
67-
if x == "*" or y == "" or y == ".*":
67+
if x == "*" or x.startswith("*") or y == "" or y == ".*":
6868
return True
6969
if x.startswith(y) and "*" in x:
7070
return True

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

+7
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ def template():
226226
},
227227
[],
228228
),
229+
(
230+
{
231+
"Action": ["cloudformation:CreateStack"],
232+
"Resource": ["arn:aws:cloudformation:us-east-1:123456789012:*dne*"],
233+
},
234+
[],
235+
),
229236
(
230237
{
231238
"Action": ["cloudformation:CreateStack"],

0 commit comments

Comments
 (0)