@@ -101,7 +101,7 @@ def match(self, cfn: Template) -> RuleMatches:
101
101
# !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
102
102
# is valid even with aws as the account #. This handles empty string
103
103
if self .config ["partition" ] and not re .match (
104
- r"^\$\{\w+}|\$\{AWS::Partition}|$" , candidate [0 ]
104
+ r"^\$\{\w+}|\$\{AWS::Partition}|\*| $" , candidate [0 ]
105
105
):
106
106
# or not re.match(r'^(\$\{\w+}|\$\{AWS::Region}|)$',candidate[1])
107
107
# or not re.match(r'^\$\{\w+}|\$\{AWS::AccountId}|aws|$', candidate[2]):
@@ -111,7 +111,7 @@ def match(self, cfn: Template) -> RuleMatches:
111
111
)
112
112
matches .append (RuleMatch (path , message .format (path [1 ])))
113
113
if self .config ["region" ] and not re .match (
114
- r"^(\$\{\w+}|\$\{AWS::Region}|)$" , candidate [1 ]
114
+ r"^(\$\{\w+}|\$\{AWS::Region}|\*| )$" , candidate [1 ]
115
115
):
116
116
# or or not re.match(r'^\$\{\w+}|\$\{AWS::AccountId}|aws|$', candidate[2]):
117
117
message = (
@@ -123,7 +123,7 @@ def match(self, cfn: Template) -> RuleMatches:
123
123
# Lambda is added for authorizer's Uniform Resource Identifier (URI)
124
124
# https://github.com/aws-cloudformation/cfn-lint/issues/3716
125
125
if self .config ["accountId" ] and not re .match (
126
- r"^\$\{\w+}|\$\{AWS::AccountId}|aws|lambda|$" , candidate [2 ]
126
+ r"^\$\{\w+}|\$\{AWS::AccountId}|aws|lambda|\*| $" , candidate [2 ]
127
127
):
128
128
if candidate [2 ] not in ["cloudfront" ]:
129
129
message = (
0 commit comments