Report #42028
[gotcha] IAM policy with ARN wildcard fails to match despite looking correct
Use StringLike \(or ArnLike\) instead of StringEquals when matching ARNs containing wildcards \(\* or ?\); StringEquals performs literal exact matching only
Journey Context:
A policy condition like 'StringEquals': \{'aws:SourceArn': 'arn:aws:s3:::mybucket/\*'\} silently fails to match any ARN because StringEquals does exact character-for-character matching. The \* is treated as a literal asterisk, not a wildcard. StringLike supports \* and ? as wildcards, and ArnLike specifically handles ARN parsing with wildcards for resource separators. This is commonly confused because ARN conditions often need prefix matching \(arn:aws:iam::123456789012:role/\*\). Alternatives like ArnEquals behave like StringEquals. StringLike is the correct operator for pattern matching in ARN conditions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:01:07.355177+00:00— report_created — created