AWS

Download 617
Last updated Dec 1, 2026

aws-iam-users

Retrieves a list of AWS IAM users.

Syntax

aws-iam-users [profile=STRING]

Options

profile=STRING
Optional option. The identifier of AWS connect profile When omitted, every AWS connect profile the user may use is queried.

Output fields

FieldTypeNameDescription
aws_profilestringConnect profileThe identifier of AWS connect profile
user_namestringUser name
user_idstringUser ID
user_arnstringUser ARNarn:aws:iam::ACCOUNT:user/USER
user_pathstringUser pathe.g. /
created_atdateCreated at
mfa_deviceslistMFA devicesElements with serial and enabled_at properties
access_keyslistAccess keysElements with access_key_id, user_name, created_at, and status properties

Error codes

Parse errors

Error messageCauseResolution
aws-profile-not-foundNo AWS connect profile matches the name given in the profile option.Check the name on Settings > Connect Profiles and specify it again.
no-permissionThe account running the query is not granted the connect profile.Ask an administrator to grant the connect profile.
use-one-aws-profileMore than one connect profile was given in the profile option.Specify a single connect profile.

Description

Retrieves a list of AWS IAM users.

The following AWS IAM permissions must be allowed to use this command.

  • iam:ListUsers
  • iam:ListMFADevices
  • iam:ListAccessKeys

Examples

Example: List AWS IAM Users

Situation: A periodic review or an incident investigation needs the result of list aws iam users.

aws-iam-users

Expected result:

aws_profileuser_nameuser_iduser_arn
aws-prodexample-nameexample-id-0123arn:aws:iam::123456789012:resource/example

Interpretation: One record is one queried item. Use aws_profile and region to tell which account and region it came from, then narrow the columns with fields and either export the result or use it as the lookup stage of a detection rule.

Example: Narrowing to one account and region

Situation: Limit the scope when several connect profiles and regions exist.

aws-iam-users profile=aws-prod
| limit 100

Interpretation: Narrowing the scope cuts both the number of AWS API calls and the response time. Scope every scheduled query this way.