AWS Identity and Access Management
CLI Reference (API Version 2010-05-08)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

iam-virtualmfadevicelist

Description

Lists the virtual MFA devices under the AWS account by assignment status. If you do not specify an assignment status, the command returns a list of all virtual MFA devices. Assignment status can be Assigned, Unassigned, or Any. You can paginate the results using the MaxItems and Marker options.

For more information about virtual MFA devices, go to Using a Virtual MFA Device in Using AWS Identity and Access Management.

Syntax

iam-virtualmfadevicelist -t ASSIGNMENTSTATUS [-v]

Options

Name Description Required

-t ASSIGNMENTSTATUS

The type of virtual MFA device to list.

Type: String

Valid Values: Any | Assigned | Unassigned

Yes

-v  

If the virtual MFA device is assigned, displays the device serial number, the ARN of the user the device is assigned to, and the user ID. If the device is assigned at the root account level, the user ID is the account number. If the device is unassigned, only the MFA device serial number is returned.

Type: String

Default: None

No

-i MAXITEMS

Use this only when paginating results to indicate the maximum number of items you want in the response. If there are additional items beyond the maximum you specify, the IsTruncated response element is true. This parameter is optional.  If you don't include it, it defaults to 100.

Type: String

Default: None

No

-m MARKER

Use this only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.

Type: String

Default: None

No

Output

The output contains a list of virtual MFA devices associated with the AWS account.

Examples

The following example lists the virtual MFA devices associated with the account, where there are three devices associated with the account and ASSIGNMENTSTATUS is Any. The first serial number is for an unassigned device, the second serial number is for a device assigned at the root account level, the third serial number is for a device assigned to a user under the account named ExampleUser.

PROMPT> iam-virtualmfadevicelist -t Any –v
arn:aws:iam::123456789012:mfa/ExampleMFAdeviceName
arn:aws:iam::123456789012:mfa/RootMFAdeviceName
arn:aws:iam::123456789012:root
123456789012
arn:aws:iam::123456789012:mfa/ExampleUserMFAdeviceName
arn:aws:iam::123456789012:user/ExampleUser
AIDACKCEVSQ6C2EXAMPLE
IsTruncated: false