Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class DeleteVirtualMFADeviceCommandProtected

Deletes a virtual MFA device.

You must deactivate a user's virtual MFA device before you can delete it. For information about deactivating MFA devices, see DeactivateMFADevice.

Example

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

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

Param

DeleteVirtualMFADeviceCommandInput

Returns

DeleteVirtualMFADeviceCommandOutput

See

Throws

ConcurrentModificationException (client fault)

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

Throws

DeleteConflictException (client fault)

The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

Throws

LimitExceededException (client fault)

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.

Throws

NoSuchEntityException (client fault)

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

Throws

ServiceFailureException (server fault)

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

Throws

IAMServiceException

Base exception class for all service exceptions from IAM service.

Example

To remove a virtual MFA device

// The following delete-virtual-mfa-device command removes the specified MFA device from the current AWS account.
const input = {
"SerialNumber": "arn:aws:iam::123456789012:mfa/ExampleName"
};
const command = new DeleteVirtualMFADeviceCommand(input);
await client.send(command);
// example id: 2933b08b-dbe7-4b89-b8c1-fdf75feea1ee

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods