Use GetServiceLinkedRoleDeletionStatus with an Amazon SDK or command line tool - Amazon Identity and Access Management
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use GetServiceLinkedRoleDeletionStatus with an Amazon SDK or command line tool

The following code examples show how to use GetServiceLinkedRoleDeletionStatus.

Amazon CLI

To check the status of a request to delete a service-linked role

The following get-service-linked-role-deletion-status example displays the status of a previously request to delete a service-linked role. The delete operation occurs asynchronously. When you make the request, you get a DeletionTaskId value that you provide as a parameter for this command.

aws iam get-service-linked-role-deletion-status \ --deletion-task-id task/aws-service-role/


{ "Status": "SUCCEEDED" }

For more information, see Using service-linked roles in the Amazon IAM User Guide.

SDK for JavaScript (v3)

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

import { GetServiceLinkedRoleDeletionStatusCommand, IAMClient, } from "@aws-sdk/client-iam"; const client = new IAMClient({}); /** * * @param {string} deletionTaskId */ export const getServiceLinkedRoleDeletionStatus = (deletionTaskId) => { const command = new GetServiceLinkedRoleDeletionStatusCommand({ DeletionTaskId: deletionTaskId, }); return client.send(command); };

For a complete list of Amazon SDK developer guides and code examples, see Using IAM with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.