Provides an IAM Virtual MFA Device.
Using certs on file:
resource "aws_iam_virtual_mfa_device" "example" {
virtual_mfa_device_name = "example"
}
This resource supports the following arguments:
virtual_mfa_device_name
- (Required) The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.path
– (Optional) The path for the virtual MFA device.tags
- (Optional) Map of resource tags for the virtual mfa device. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.This resource exports the following attributes in addition to the arguments above:
arn
- The Amazon Resource Name (ARN) specifying the virtual mfa device.base_32_string_seed
- The base32 seed defined as specified in RFC3548. The base_32_string_seed
is base64-encoded.enable_date
- The date and time when the virtual MFA device was enabled.qr_code_png
- A QR code PNG image that encodes otpauth://totp/$virtualMFADeviceName@$AccountName?secret=$Base32String
where $virtualMFADeviceName
is one of the create call arguments. AccountName is the user name if set (otherwise, the account ID), and Base32String is the seed in base32 format.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.user_name
- The associated IAM User name if the virtual MFA device is enabled.In Terraform v1.5.0 and later, use an import
block to import IAM Virtual MFA Devices using the arn
. For example:
import {
to = aws_iam_virtual_mfa_device.example
id = "arn:aws:iam::123456789012:mfa/example"
}
Using terraform import
, import IAM Virtual MFA Devices using the arn
. For example:
% terraform import aws_iam_virtual_mfa_device.example arn:aws:iam::123456789012:mfa/example