Jump to Content

Returns all the tagged or previously tagged resources that are located in the specified Amazon Web Services Region for the account.

Depending on what information you want returned, you can also specify the following:

  • Filters that specify what tags and resource types you want returned. The response includes all tags that are associated with the requested resources.

  • Information about compliance with the account's effective tag policy. For more information on tag policies, see Tag Policies in the Organizations User Guide.

This operation supports pagination, where the response can be sent in multiple pages. You should check the PaginationToken response parameter to determine if there are additional results available to return. Repeat the query, passing the PaginationToken response parameter value as an input to the next request until you recieve a null value. A null value for PaginationToken indicates that there are no more results waiting to be returned.


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

import { ResourceGroupsTaggingAPIClient, GetResourcesCommand } from "@aws-sdk/client-resource-groups-tagging-api"; // ES Modules import
// const { ResourceGroupsTaggingAPIClient, GetResourcesCommand } = require("@aws-sdk/client-resource-groups-tagging-api"); // CommonJS import
const client = new ResourceGroupsTaggingAPIClient(config);
const command = new GetResourcesCommand(input);
const response = await client.send(command);







InternalServiceException (server fault)

The request processing failed because of an unknown error, exception, or failure. You can retry the request.


InvalidParameterException (client fault)

This error indicates one of the following:

  • A parameter is missing.

  • A malformed string was supplied for the request parameter.

  • An out-of-range value was supplied for the request parameter.

  • The target ID is invalid, unsupported, or doesn't exist.

  • You can't access the Amazon S3 bucket for report storage. For more information, see Additional Requirements for Organization-wide Tag Compliance Reports in the Organizations User Guide.


PaginationTokenExpiredException (client fault)

A PaginationToken is valid for a maximum of 15 minutes. Your request was denied because the specified PaginationToken has expired.


ThrottledException (client fault)

The request was denied to limit the frequency of submitted requests.




middlewareStack: MiddlewareStack<GetResourcesCommandInput, GetResourcesCommandOutput>