

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::IAM::VirtualMFADevice
<a name="aws-resource-iam-virtualmfadevice"></a>

Creates a new virtual MFA device for the AWS account. After creating the virtual MFA, use [EnableMFADevice](https://docs.aws.amazon.com/IAM/latest/APIReference/API_EnableMFADevice.html) 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) in the *IAM User Guide*.

For information about the maximum number of MFA devices you can create, see [IAM and AWS STS quotas](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) in the *IAM User Guide*.

**Important**  
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 AWS access keys or your passwords. After you provision your virtual device, you should ensure that the information is destroyed following secure procedures.

## Syntax
<a name="aws-resource-iam-virtualmfadevice-syntax"></a>

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

### JSON
<a name="aws-resource-iam-virtualmfadevice-syntax.json"></a>

```
{
  "Type" : "AWS::IAM::VirtualMFADevice",
  "Properties" : {
      "[Path](#cfn-iam-virtualmfadevice-path)" : String,
      "[Tags](#cfn-iam-virtualmfadevice-tags)" : [ Tag, ... ],
      "[Users](#cfn-iam-virtualmfadevice-users)" : [ String, ... ],
      "[VirtualMfaDeviceName](#cfn-iam-virtualmfadevice-virtualmfadevicename)" : String
    }
}
```

### YAML
<a name="aws-resource-iam-virtualmfadevice-syntax.yaml"></a>

```
Type: AWS::IAM::VirtualMFADevice
Properties:
  [Path](#cfn-iam-virtualmfadevice-path): String
  [Tags](#cfn-iam-virtualmfadevice-tags): 
    - Tag
  [Users](#cfn-iam-virtualmfadevice-users): 
    - String
  [VirtualMfaDeviceName](#cfn-iam-virtualmfadevice-virtualmfadevicename): String
```

## Properties
<a name="aws-resource-iam-virtualmfadevice-properties"></a>

`Path`  <a name="cfn-iam-virtualmfadevice-path"></a>
 The path for the virtual MFA device. For more information about paths, see [IAM identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) 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](http://wikipedia.org/wiki/regex)) 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 \$1 (`\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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-iam-virtualmfadevice-tags"></a>
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](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) 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](aws-properties-iam-virtualmfadevice-tag.md)  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Users`  <a name="cfn-iam-virtualmfadevice-users"></a>
The IAM user associated with this virtual MFA device.  
*Required*: Yes  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`VirtualMfaDeviceName`  <a name="cfn-iam-virtualmfadevice-virtualmfadevicename"></a>
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](http://wikipedia.org/wiki/regex)) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \$1\$1=,.@-  
*Required*: No  
*Type*: String  
*Pattern*: `[\w+=,.@-]+`  
*Minimum*: `1`  
*Maximum*: `226`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-iam-virtualmfadevice-return-values"></a>

### Ref
<a name="aws-resource-iam-virtualmfadevice-return-values-ref"></a>

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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-iam-virtualmfadevice-return-values-fn--getatt"></a>

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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-iam-virtualmfadevice-return-values-fn--getatt-fn--getatt"></a>

`SerialNumber`  <a name="SerialNumber-fn::getatt"></a>
Returns the serial number for the specified `AWS::IAM::VirtualMFADevice` resource.

# AWS::IAM::VirtualMFADevice Tag
<a name="aws-properties-iam-virtualmfadevice-tag"></a>

A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide*.

## Syntax
<a name="aws-properties-iam-virtualmfadevice-tag-syntax"></a>

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

### JSON
<a name="aws-properties-iam-virtualmfadevice-tag-syntax.json"></a>

```
{
  "[Key](#cfn-iam-virtualmfadevice-tag-key)" : String,
  "[Value](#cfn-iam-virtualmfadevice-tag-value)" : String
}
```

### YAML
<a name="aws-properties-iam-virtualmfadevice-tag-syntax.yaml"></a>

```
  [Key](#cfn-iam-virtualmfadevice-tag-key): String
  [Value](#cfn-iam-virtualmfadevice-tag-value): String
```

## Properties
<a name="aws-properties-iam-virtualmfadevice-tag-properties"></a>

`Key`  <a name="cfn-iam-virtualmfadevice-tag-key"></a>
The key name that can be used to look up or retrieve the associated value. For example, `Department` or `Cost Center` are common choices.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-iam-virtualmfadevice-tag-value"></a>
The value associated with this tag. For example, tags with a key name of `Department` could have values such as `Human Resources`, `Accounting`, and `Support`. Tags with a key name of `Cost Center` might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)