Skip to main content
Regexflux

AWS Access Key ID

beginner

Detects AWS access key IDs starting with AKIA.

awssecuritycredentialscanning

Pattern

/(?:AKIA|ASIA)[A-Z0-9]{16}/g

Try It

0 of 5 strings matched

Explanation

Matches AWS access key IDs: prefix AKIA (long-term) or ASIA (temporary STS) followed by exactly 16 uppercase alphanumeric characters.

Test Strings

Matching

  • AKIAIOSFODNN7EXAMPLE
  • ASIAJEXAMPLEKEY12345

Non-matching

  • AKID1234567890123456
  • akia-lowercase-key
  • AKIA_too_short

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOFull support

Code Snippets

const regex = /(?:AKIA|ASIA)[A-Z0-9]{16}/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Common Variations

AWS Secret Key

[a-zA-Z0-9/+=]{40}

Matches 40-char base64 AWS secret access keys

Related Patterns