AWS

Download 604
Last updated Dec 1, 2026

aws-iam-policy-version

Retrieves IAM customer-managed policy default version documents and wildcard usage.

Syntax

aws-iam-policy-version [profile=STRING] [policy-arn=STRING]

Options

profile=STRING
Optional option. The identifier of AWS connect profile When omitted, every AWS connect profile the user may use is queried.
policy-arn=STRING
Optional option. Target policy ARN; all local policies if omitted

Output fields

FieldTypeNameDescription
aws_profilestringConnect profileAWS connect profile identifier
policy_arnstringPolicy ARN
policy_namestringPolicy name
version_idstringVersion IDdefault version ID
documentstringDocumentURL-decoded policy document JSON
has_wildcard_actionboolHas wildcard actiontrue = Action "*" present
has_wildcard_resourceboolHas wildcard resourcetrue = Resource "*" present

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 IAM customer-managed policy default version documents and wildcard usage.

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

  • iam:GetPolicy
  • iam:GetPolicyVersion
Note
This command is available from AWS app 2.0.2612.0.

Examples

Example: Get IAM Policy Version

Situation: A periodic review or an incident investigation needs the result of get iam policy version.

aws-iam-policy-version

Expected result:

aws_profilepolicy_arnpolicy_nameversion_id
aws-prodarn:aws:iam::123456789012:resource/exampleexample-nameexample-id-0123

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-policy-version 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.