ResyncMFADeviceCommand

Synchronizes the specified MFA device with its IAM resource object on the Amazon Web Services servers.

For more information about creating and working with virtual MFA devices, see Using a virtual MFA device  in the IAM User Guide.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { IAMClient, ResyncMFADeviceCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, ResyncMFADeviceCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const input = { // ResyncMFADeviceRequest
  UserName: "STRING_VALUE", // required
  SerialNumber: "STRING_VALUE", // required
  AuthenticationCode1: "STRING_VALUE", // required
  AuthenticationCode2: "STRING_VALUE", // required
};
const command = new ResyncMFADeviceCommand(input);
const response = await client.send(command);
// {};

ResyncMFADeviceCommand Input

See ResyncMFADeviceCommandInput for more details

Parameter
Type
Description
AuthenticationCode1
Required
string | undefined

An authentication code emitted by the device.

The format for this parameter is a sequence of six digits.

AuthenticationCode2
Required
string | undefined

A subsequent authentication code emitted by the device.

The format for this parameter is a sequence of six digits.

SerialNumber
Required
string | undefined

Serial number that uniquely identifies the 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: _+=,.-

UserName
Required
string | undefined

The name of the user whose MFA device you want to resynchronize.

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

ResyncMFADeviceCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
ConcurrentModificationException
client

The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

InvalidAuthenticationCodeException
client

The request was rejected because the authentication code was not recognized. The error message describes the specific error.

LimitExceededException
client

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.

NoSuchEntityException
client

The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

ServiceFailureException
server

The request processing has failed because of an unknown error, exception or failure.

IAMServiceException
Base exception class for all service exceptions from IAM service.