The following code examples show how to use CreateVirtualMfaDevice
.
- AWS CLI
-
To create a virtual MFA device
This example creates a new virtual MFA device called
BobsMFADevice
. It creates a file that contains bootstrap information calledQRCode.png
and places it in theC:/
directory. The bootstrap method used in this example isQRCodePNG
.aws iam create-virtual-mfa-device \ --virtual-mfa-device-name
BobsMFADevice
\ --outfileC:/QRCode.png
\ --bootstrap-methodQRCodePNG
Output:
{ "VirtualMFADevice": { "SerialNumber": "arn:aws:iam::210987654321:mfa/BobsMFADevice" }
For more information, see Using multi-factor authentication (MFA) in AWS in the AWS IAM User Guide.
-
For API details, see CreateVirtualMfaDevice
in AWS CLI Command Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Using this service with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.