mfa_devices
Creates, updates, deletes, gets or lists a mfa_devices resource.
Overview
| Name | mfa_devices |
| Type | Resource |
| Id | aws.iam.mfa_devices |
Fields
The following fields are returned by SELECT queries:
- get_mfa_device
- list_mfa_devices
| Name | Datatype | Description |
|---|---|---|
certifications | string | The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from FIDO Alliance Metadata Service (MDS). |
enable_date | string | The date that a specified user's MFA device was first enabled. |
serial_number | string | Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. |
user_name | string | The friendly name identifying the user. |
| Name | Datatype | Description |
|---|---|---|
enable_date | string | The date when the MFA device was enabled for the user. |
serial_number | string | The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the device ARN. |
user_name | string | The user with whom the MFA device is associated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_mfa_device | select | SerialNumber, region | UserName | Retrieves information about an MFA device for a specified user. |
list_mfa_devices | select | region | UserName, Marker, MaxItems | Lists the MFA devices for an IAM user. If the request includes a IAM user name, then this operation lists all the MFA devices associated with the specified user. If you do not specify a user name, IAM determines the user name implicitly based on the Amazon Web Services access key ID signing the request for this operation. You can paginate the results using the MaxItems and Marker parameters. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
SerialNumber | string | Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. |
region | string | AWS region (default: us-east-1) |
Marker | string | Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start. |
MaxItems | integer | Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true. If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true, and Marker contains a value to include in the subsequent call that tells the service where to continue from. |
UserName | string | The name of the user whose MFA devices you want to list. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@- |
SELECT examples
- get_mfa_device
- list_mfa_devices
Retrieves information about an MFA device for a specified user.
SELECT
certifications,
enable_date,
serial_number,
user_name
FROM aws.iam.mfa_devices
WHERE SerialNumber = '{{ SerialNumber }}' -- required
AND region = '{{ region }}' -- required
AND UserName = '{{ UserName }}'
;
Lists the MFA devices for an IAM user. If the request includes a IAM user name, then this operation lists all the MFA devices associated with the specified user. If you do not specify a user name, IAM determines the user name implicitly based on the Amazon Web Services access key ID signing the request for this operation. You can paginate the results using the MaxItems and Marker parameters.
SELECT
enable_date,
serial_number,
user_name
FROM aws.iam.mfa_devices
WHERE region = '{{ region }}' -- required
AND UserName = '{{ UserName }}'
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;