File tree 2 files changed +18
-9
lines changed
src/cfnlint/rules/resources/iam
test/unit/rules/resources/iam
2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -158,15 +158,17 @@ def validate(
158
158
].get ("ARNFormats" )
159
159
for arn_format in arn_formats :
160
160
arn = _Arn (arn_format )
161
- if arn not in all_resource_arns :
162
- yield ValidationError (
163
- (
164
- f"action { action !r} requires "
165
- f"a resource of { arn_formats !r} "
166
- ),
167
- path = deque (["Resource" ]),
168
- rule = self ,
169
- )
161
+ if arn in all_resource_arns :
162
+ break
163
+ else :
164
+ yield ValidationError (
165
+ (
166
+ f"action { action !r} requires "
167
+ f"a resource of { arn_formats !r} "
168
+ ),
169
+ path = deque (["Resource" ]),
170
+ rule = self ,
171
+ )
170
172
else :
171
173
LOGGER .debug (f"action { action !r} requires a resource of '*'" )
172
174
# yield ValidationError(
Original file line number Diff line number Diff line change @@ -112,6 +112,13 @@ def template():
112
112
},
113
113
[],
114
114
),
115
+ (
116
+ {
117
+ "Action" : "ec2:CreateTags" ,
118
+ "Resource" : ["arn:aws:ec2:*::snapshot/*" ],
119
+ },
120
+ [],
121
+ ),
115
122
(
116
123
{
117
124
"Action" : "cloudformation:CreateStackSet" ,
You can’t perform that action at this time.
0 commit comments