GetServiceLinkedRoleDeletionStatusCommand

Retrieves the status of your service-linked role deletion. After you use DeleteServiceLinkedRole to submit a service-linked role for deletion, you can use the DeletionTaskId parameter in GetServiceLinkedRoleDeletionStatus to check the status of the deletion. If the deletion fails, this operation returns the reason that it failed, if that information is returned by the service.

Example Syntax

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

import { IAMClient, GetServiceLinkedRoleDeletionStatusCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, GetServiceLinkedRoleDeletionStatusCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const input = { // GetServiceLinkedRoleDeletionStatusRequest
  DeletionTaskId: "STRING_VALUE", // required
};
const command = new GetServiceLinkedRoleDeletionStatusCommand(input);
const response = await client.send(command);
// { // GetServiceLinkedRoleDeletionStatusResponse
//   Status: "SUCCEEDED" || "IN_PROGRESS" || "FAILED" || "NOT_STARTED", // required
//   Reason: { // DeletionTaskFailureReasonType
//     Reason: "STRING_VALUE",
//     RoleUsageList: [ // RoleUsageListType
//       { // RoleUsageType
//         Region: "STRING_VALUE",
//         Resources: [ // ArnListType
//           "STRING_VALUE",
//         ],
//       },
//     ],
//   },
// };

GetServiceLinkedRoleDeletionStatusCommand Input

Parameter
Type
Description
DeletionTaskId
Required
string | undefined

The deletion task identifier. This identifier is returned by the DeleteServiceLinkedRole operation in the format task/aws-service-role///.

GetServiceLinkedRoleDeletionStatusCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Status
Required
DeletionTaskStatusType | undefined

The status of the deletion.

Reason
DeletionTaskFailureReasonType | undefined

An object that contains details about the reason the deletion failed.

Throws

Name
Fault
Details
InvalidInputException
client

The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

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.