ListRules - Recycle Bin
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).


Lists the Recycle Bin retention rules in the Region.

Request Syntax

POST /list-rules HTTP/1.1 Content-type: application/json { "LockState": "string", "MaxResults": number, "NextToken": "string", "ResourceTags": [ { "ResourceTagKey": "string", "ResourceTagValue": "string" } ], "ResourceType": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.


The lock state of the retention rules to list. Only retention rules with the specified lock state are returned.

Type: String

Valid Values: locked | pending_unlock | unlocked

Required: No


The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned NextToken value.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 1000.

Required: No


The token for the next page of results.

Type: String

Pattern: ^[A-Za-z0-9+/=]{1,2048}$

Required: No


Information about the resource tags used to identify resources that are retained by the retention rule.

Type: Array of ResourceTag objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No


The resource type retained by the retention rule. Only retention rules that retain the specified resource type are listed. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To list retention rules that retain snapshots, specify EBS_SNAPSHOT. To list retention rules that retain EBS-backed AMIs, specify EC2_IMAGE.

Type: String


Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "NextToken": "string", "Rules": [ { "Description": "string", "Identifier": "string", "LockState": "string", "RetentionPeriod": { "RetentionPeriodUnit": "string", "RetentionPeriodValue": number }, "RuleArn": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The token to use to retrieve the next page of results. This value is null when there are no more results to return.

Type: String

Pattern: ^[A-Za-z0-9+/=]{1,2048}$


Information about the retention rules.

Type: Array of RuleSummary objects


For information about the errors that are common to all actions, see Common Errors.


The service could not respond to the request due to an internal problem.

HTTP Status Code: 500


One or more of the parameters in the request is not valid.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: