AWS::IAM::VirtualMFADevice - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Creates a new virtual MFA device for the Amazon Web Services account. After creating the virtual MFA, use EnableMFADevice to attach the MFA device to an IAM user. For more information about creating and working with virtual MFA devices, see Using a virtual MFA device in the IAM User Guide.

For information about the maximum number of MFA devices you can create, see IAM and Amazon STS quotas in the IAM User Guide.


The seed information contained in the QR code and the Base32 string should be treated like any other secret access information. In other words, protect the seed information as you would your Amazon access keys or your passwords. After you provision your virtual device, you should ensure that the information is destroyed following secure procedures.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::IAM::VirtualMFADevice", "Properties" : { "Path" : String, "Tags" : [ Tag, ... ], "Users" : [ String, ... ], "VirtualMfaDeviceName" : String } }


Type: AWS::IAM::VirtualMFADevice Properties: Path: String Tags: - Tag Users: - String VirtualMfaDeviceName: String



The path for the virtual MFA device. For more information about paths, see IAM identifiers in the IAM User Guide.

This parameter is optional. If it is not included, it defaults to a slash (/).

This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

Required: No

Type: String

Pattern: (\u002F)|(\u002F[\u0021-\u007F]+\u002F)

Minimum: 1

Maximum: 512

Update requires: Replacement


A list of tags that you want to attach to the new IAM virtual MFA device. Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide.


If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.

Required: No

Type: Array of Tag

Maximum: 50

Update requires: No interruption


The IAM user associated with this virtual MFA device.

Required: Yes

Type: Array of String

Update requires: No interruption


The name of the virtual MFA device, which must be unique. Use with path to uniquely identify a virtual MFA device.

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: _+=,.@-

Required: No

Type: String

Pattern: [\w+=,.@-]+

Minimum: 1

Maximum: 226

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the SerialNumber.

For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


Returns the serial number for the specified AWS::IAM::VirtualMFADevice resource.