create_virtual_mfa_device
¶
create_virtual_mfa_device(
virtual_mfa_device_name: virtualMFADeviceName,
*,
config_overrides: Optional[IAMClientConfig] = None,
path: Optional[pathType] = None,
tags: Optional[tagListType] = None,
) -> CreateVirtualMFADeviceResponse
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 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 Web Services access keys or your passwords. After you provision your virtual device, you should ensure that the information is destroyed following secure procedures.
Parameters:
-
path(Optional[pathType], default:None) –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. -
virtual_mfa_device_name(virtualMFADeviceName) –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: _+=,.@-
-
tags(Optional[tagListType], default:None) –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.
Raises:
-
ConcurrentModificationException–The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.
-
EntityAlreadyExistsException–The request was rejected because it attempted to create a resource that already exists.
-
InvalidInputException–The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
LimitExceededException–The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.
-
ServiceFailureException–The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iam/_services/iam.py
2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 | |