

# Actions
<a name="API_Operations"></a>

The following actions are supported:
+  [CreateRule](API_CreateRule.md) 
+  [DeleteRule](API_DeleteRule.md) 
+  [GetRule](API_GetRule.md) 
+  [ListRules](API_ListRules.md) 
+  [ListTagsForResource](API_ListTagsForResource.md) 
+  [LockRule](API_LockRule.md) 
+  [TagResource](API_TagResource.md) 
+  [UnlockRule](API_UnlockRule.md) 
+  [UntagResource](API_UntagResource.md) 
+  [UpdateRule](API_UpdateRule.md) 

# CreateRule
<a name="API_CreateRule"></a>

Creates a Recycle Bin retention rule. You can create two types of retention rules:
+  **Tag-level retention rules** - These retention rules use resource tags to identify the resources to protect. For each retention rule, you specify one or more tag key and value pairs. Resources (of the specified type) that have at least one of these tag key and value pairs are automatically retained in the Recycle Bin upon deletion. Use this type of retention rule to protect specific resources in your account based on their tags.
+  **Region-level retention rules** - These retention rules, by default, apply to all of the resources (of the specified type) in the Region, even if the resources are not tagged. However, you can specify exclusion tags to exclude resources that have specific tags. Use this type of retention rule to protect all resources of a specific type in a Region.

For more information, see [ Create Recycle Bin retention rules](https://docs.aws.amazon.com/ebs/latest/userguide/recycle-bin.html) in the *Amazon EBS User Guide*.

## Request Syntax
<a name="API_CreateRule_RequestSyntax"></a>

```
POST /rules HTTP/1.1
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "LockConfiguration": { 
      "UnlockDelay": { 
         "UnlockDelayUnit": "string",
         "UnlockDelayValue": number
      }
   },
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   },
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## URI Request Parameters
<a name="API_CreateRule_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_CreateRule_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [Description](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$`   
Required: No

 ** [ExcludeResourceTags](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-ExcludeResourceTags"></a>
[Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. Resources that have any of these tags are not retained by the retention rule upon deletion.  
You can't specify exclusion tags for tag-level retention rules.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.  
Required: No

 ** [LockConfiguration](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-LockConfiguration"></a>
Information about the retention rule lock configuration.  
Type: [LockConfiguration](API_LockConfiguration.md) object  
Required: No

 ** [ResourceTags](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-ResourceTags"></a>
[Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.  
You can add the same tag key and value pair to a maximum or five retention rules.  
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [ResourceType](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-ResourceType"></a>
The resource type to be retained by the retention rule. Currently, only EBS volumes, EBS snapshots, and EBS-backed AMIs are supported.  
+ To retain EBS volumes, specify `EBS_VOLUME`.
+ To retain EBS snapshots, specify `EBS_SNAPSHOT` 
+ To retain EBS-backed AMIs, specify `EC2_IMAGE`.
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME`   
Required: Yes

 ** [RetentionPeriod](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object  
Required: Yes

 ** [Tags](#API_CreateRule_RequestSyntax) **   <a name="recyclebin-CreateRule-request-Tags"></a>
Information about the tags to assign to the retention rule.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

## Response Syntax
<a name="API_CreateRule_ResponseSyntax"></a>

```
HTTP/1.1 201
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "Identifier": "string",
   "LockConfiguration": { 
      "UnlockDelay": { 
         "UnlockDelayUnit": "string",
         "UnlockDelayValue": number
      }
   },
   "LockState": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   },
   "RuleArn": "string",
   "Status": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Response Elements
<a name="API_CreateRule_ResponseElements"></a>

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

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

 ** [Description](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$` 

 ** [ExcludeResourceTags](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-ExcludeResourceTags"></a>
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.

 ** [Identifier](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-Identifier"></a>
The unique ID of the retention rule.  
Type: String  
Pattern: `[0-9a-zA-Z]{11}` 

 ** [LockConfiguration](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-LockConfiguration"></a>
Information about the retention rule lock configuration.  
Type: [LockConfiguration](API_LockConfiguration.md) object

 ** [LockState](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-LockState"></a>
[Region-level retention rules only] The lock state for the retention rule.  
+  `locked` - The retention rule is locked and can't be modified or deleted.
+  `pending_unlock` - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.
+  `unlocked` - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.
+  `null` - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the `locked` and `unlocked` states only; it can never transition back to `null`.
Type: String  
Valid Values: `locked | pending_unlock | unlocked` 

 ** [ResourceTags](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-ResourceTags"></a>
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [ResourceType](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-ResourceType"></a>
The resource type retained by the retention rule.  
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME` 

 ** [RetentionPeriod](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object

 ** [RuleArn](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-RuleArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$` 

 ** [Status](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-Status"></a>
The state of the retention rule. Only retention rules that are in the `available` state retain resources.  
Type: String  
Valid Values: `pending | available` 

 ** [Tags](#API_CreateRule_ResponseSyntax) **   <a name="recyclebin-CreateRule-response-Tags"></a>
Information about the tags assigned to the retention rule.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

## Errors
<a name="API_CreateRule_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ServiceQuotaExceededException **   
The request would cause a service quota for the number of tags per resource to be exceeded.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 402

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_CreateRule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/CreateRule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/CreateRule) 

# DeleteRule
<a name="API_DeleteRule"></a>

Deletes a Recycle Bin retention rule. For more information, see [ Delete Recycle Bin retention rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-delete-rule) in the *Amazon Elastic Compute Cloud User Guide*.

## Request Syntax
<a name="API_DeleteRule_RequestSyntax"></a>

```
DELETE /rules/identifier HTTP/1.1
```

## URI Request Parameters
<a name="API_DeleteRule_RequestParameters"></a>

The request uses the following URI parameters.

 ** [identifier](#API_DeleteRule_RequestSyntax) **   <a name="recyclebin-DeleteRule-request-uri-Identifier"></a>
The unique ID of the retention rule.  
Pattern: `[0-9a-zA-Z]{11}`   
Required: Yes

## Request Body
<a name="API_DeleteRule_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_DeleteRule_ResponseSyntax"></a>

```
HTTP/1.1 204
```

## Response Elements
<a name="API_DeleteRule_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

## Errors
<a name="API_DeleteRule_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
The specified retention rule lock request can't be completed.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 409

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_DeleteRule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/DeleteRule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/DeleteRule) 

# GetRule
<a name="API_GetRule"></a>

Gets information about a Recycle Bin retention rule.

## Request Syntax
<a name="API_GetRule_RequestSyntax"></a>

```
GET /rules/identifier HTTP/1.1
```

## URI Request Parameters
<a name="API_GetRule_RequestParameters"></a>

The request uses the following URI parameters.

 ** [identifier](#API_GetRule_RequestSyntax) **   <a name="recyclebin-GetRule-request-uri-Identifier"></a>
The unique ID of the retention rule.  
Pattern: `[0-9a-zA-Z]{11}`   
Required: Yes

## Request Body
<a name="API_GetRule_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_GetRule_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "Identifier": "string",
   "LockConfiguration": { 
      "UnlockDelay": { 
         "UnlockDelayUnit": "string",
         "UnlockDelayValue": number
      }
   },
   "LockEndTime": number,
   "LockState": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   },
   "RuleArn": "string",
   "Status": "string"
}
```

## Response Elements
<a name="API_GetRule_ResponseElements"></a>

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

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

 ** [Description](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$` 

 ** [ExcludeResourceTags](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-ExcludeResourceTags"></a>
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.

 ** [Identifier](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-Identifier"></a>
The unique ID of the retention rule.  
Type: String  
Pattern: `[0-9a-zA-Z]{11}` 

 ** [LockConfiguration](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-LockConfiguration"></a>
Information about the retention rule lock configuration.  
Type: [LockConfiguration](API_LockConfiguration.md) object

 ** [LockEndTime](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-LockEndTime"></a>
The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.  
Type: Timestamp

 ** [LockState](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-LockState"></a>
[Region-level retention rules only] The lock state for the retention rule.  
+  `locked` - The retention rule is locked and can't be modified or deleted.
+  `pending_unlock` - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.
+  `unlocked` - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.
+  `null` - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the `locked` and `unlocked` states only; it can never transition back to `null`.
Type: String  
Valid Values: `locked | pending_unlock | unlocked` 

 ** [ResourceTags](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-ResourceTags"></a>
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [ResourceType](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-ResourceType"></a>
The resource type retained by the retention rule.  
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME` 

 ** [RetentionPeriod](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object

 ** [RuleArn](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-RuleArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$` 

 ** [Status](#API_GetRule_ResponseSyntax) **   <a name="recyclebin-GetRule-response-Status"></a>
The state of the retention rule. Only retention rules that are in the `available` state retain resources.  
Type: String  
Valid Values: `pending | available` 

## Errors
<a name="API_GetRule_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_GetRule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/GetRule) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/GetRule) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/GetRule) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/GetRule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/GetRule) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/GetRule) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/GetRule) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/GetRule) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/GetRule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/GetRule) 

# ListRules
<a name="API_ListRules"></a>

Lists the Recycle Bin retention rules in the Region.

## Request Syntax
<a name="API_ListRules_RequestSyntax"></a>

```
POST /list-rules HTTP/1.1
Content-type: application/json

{
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "LockState": "string",
   "MaxResults": number,
   "NextToken": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string"
}
```

## URI Request Parameters
<a name="API_ListRules_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_ListRules_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [ExcludeResourceTags](#API_ListRules_RequestSyntax) **   <a name="recyclebin-ListRules-request-ExcludeResourceTags"></a>
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.  
Required: No

 ** [LockState](#API_ListRules_RequestSyntax) **   <a name="recyclebin-ListRules-request-LockState"></a>
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

 ** [MaxResults](#API_ListRules_RequestSyntax) **   <a name="recyclebin-ListRules-request-MaxResults"></a>
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

 ** [NextToken](#API_ListRules_RequestSyntax) **   <a name="recyclebin-ListRules-request-NextToken"></a>
The token for the next page of results.  
Type: String  
Pattern: `^[A-Za-z0-9+/=]{1,2048}$`   
Required: No

 ** [ResourceTags](#API_ListRules_RequestSyntax) **   <a name="recyclebin-ListRules-request-ResourceTags"></a>
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [ResourceType](#API_ListRules_RequestSyntax) **   <a name="recyclebin-ListRules-request-ResourceType"></a>
The resource type retained by the retention rule. Only retention rules that retain the specified resource type are listed. Currently, only EBS volumes, EBS snapshots, and EBS-backed AMIs are supported.  
+ To list retention rules that retain EBS volumes, specify `EBS_VOLUME`.
+ To list retention rules that retain EBS snapshots, specify `EBS_SNAPSHOT`.
+ To list retention rules that retain EBS-backed AMIs, specify `EC2_IMAGE`.
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME`   
Required: Yes

## Response Syntax
<a name="API_ListRules_ResponseSyntax"></a>

```
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
<a name="API_ListRules_ResponseElements"></a>

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

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

 ** [NextToken](#API_ListRules_ResponseSyntax) **   <a name="recyclebin-ListRules-response-NextToken"></a>
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}$` 

 ** [Rules](#API_ListRules_ResponseSyntax) **   <a name="recyclebin-ListRules-response-Rules"></a>
Information about the retention rules.  
Type: Array of [RuleSummary](API_RuleSummary.md) objects

## Errors
<a name="API_ListRules_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_ListRules_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/ListRules) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/ListRules) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/ListRules) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/ListRules) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/ListRules) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/ListRules) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/ListRules) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/ListRules) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/ListRules) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/ListRules) 

# ListTagsForResource
<a name="API_ListTagsForResource"></a>

Lists the tags assigned to a retention rule.

## Request Syntax
<a name="API_ListTagsForResource_RequestSyntax"></a>

```
GET /tags/resourceArn HTTP/1.1
```

## URI Request Parameters
<a name="API_ListTagsForResource_RequestParameters"></a>

The request uses the following URI parameters.

 ** [resourceArn](#API_ListTagsForResource_RequestSyntax) **   <a name="recyclebin-ListTagsForResource-request-uri-ResourceArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$`   
Required: Yes

## Request Body
<a name="API_ListTagsForResource_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_ListTagsForResource_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Response Elements
<a name="API_ListTagsForResource_ResponseElements"></a>

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

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

 ** [Tags](#API_ListTagsForResource_ResponseSyntax) **   <a name="recyclebin-ListTagsForResource-response-Tags"></a>
Information about the tags assigned to the retention rule.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.

## Errors
<a name="API_ListTagsForResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_ListTagsForResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/ListTagsForResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/ListTagsForResource) 

# LockRule
<a name="API_LockRule"></a>

Locks a Region-level retention rule. A locked retention rule can't be modified or deleted.

**Note**  
You can't lock tag-level retention rules, or Region-level retention rules that have exclusion tags.

## Request Syntax
<a name="API_LockRule_RequestSyntax"></a>

```
PATCH /rules/identifier/lock HTTP/1.1
Content-type: application/json

{
   "LockConfiguration": { 
      "UnlockDelay": { 
         "UnlockDelayUnit": "string",
         "UnlockDelayValue": number
      }
   }
}
```

## URI Request Parameters
<a name="API_LockRule_RequestParameters"></a>

The request uses the following URI parameters.

 ** [identifier](#API_LockRule_RequestSyntax) **   <a name="recyclebin-LockRule-request-uri-Identifier"></a>
The unique ID of the retention rule.  
Pattern: `[0-9a-zA-Z]{11}`   
Required: Yes

## Request Body
<a name="API_LockRule_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [LockConfiguration](#API_LockRule_RequestSyntax) **   <a name="recyclebin-LockRule-request-LockConfiguration"></a>
Information about the retention rule lock configuration.  
Type: [LockConfiguration](API_LockConfiguration.md) object  
Required: Yes

## Response Syntax
<a name="API_LockRule_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "Identifier": "string",
   "LockConfiguration": { 
      "UnlockDelay": { 
         "UnlockDelayUnit": "string",
         "UnlockDelayValue": number
      }
   },
   "LockState": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   },
   "RuleArn": "string",
   "Status": "string"
}
```

## Response Elements
<a name="API_LockRule_ResponseElements"></a>

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

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

 ** [Description](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$` 

 ** [ExcludeResourceTags](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-ExcludeResourceTags"></a>
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.

 ** [Identifier](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-Identifier"></a>
The unique ID of the retention rule.  
Type: String  
Pattern: `[0-9a-zA-Z]{11}` 

 ** [LockConfiguration](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-LockConfiguration"></a>
Information about the retention rule lock configuration.  
Type: [LockConfiguration](API_LockConfiguration.md) object

 ** [LockState](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-LockState"></a>
[Region-level retention rules only] The lock state for the retention rule.  
+  `locked` - The retention rule is locked and can't be modified or deleted.
+  `pending_unlock` - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.
+  `unlocked` - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.
+  `null` - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the `locked` and `unlocked` states only; it can never transition back to `null`.
Type: String  
Valid Values: `locked | pending_unlock | unlocked` 

 ** [ResourceTags](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-ResourceTags"></a>
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [ResourceType](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-ResourceType"></a>
The resource type retained by the retention rule.  
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME` 

 ** [RetentionPeriod](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object

 ** [RuleArn](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-RuleArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$` 

 ** [Status](#API_LockRule_ResponseSyntax) **   <a name="recyclebin-LockRule-response-Status"></a>
The state of the retention rule. Only retention rules that are in the `available` state retain resources.  
Type: String  
Valid Values: `pending | available` 

## Errors
<a name="API_LockRule_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
The specified retention rule lock request can't be completed.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 409

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_LockRule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/LockRule) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/LockRule) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/LockRule) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/LockRule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/LockRule) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/LockRule) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/LockRule) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/LockRule) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/LockRule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/LockRule) 

# TagResource
<a name="API_TagResource"></a>

Assigns tags to the specified retention rule.

## Request Syntax
<a name="API_TagResource_RequestSyntax"></a>

```
POST /tags/resourceArn HTTP/1.1
Content-type: application/json

{
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## URI Request Parameters
<a name="API_TagResource_RequestParameters"></a>

The request uses the following URI parameters.

 ** [resourceArn](#API_TagResource_RequestSyntax) **   <a name="recyclebin-TagResource-request-uri-ResourceArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$`   
Required: Yes

## Request Body
<a name="API_TagResource_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [Tags](#API_TagResource_RequestSyntax) **   <a name="recyclebin-TagResource-request-Tags"></a>
Information about the tags to assign to the retention rule.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: Yes

## Response Syntax
<a name="API_TagResource_ResponseSyntax"></a>

```
HTTP/1.1 201
```

## Response Elements
<a name="API_TagResource_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 201 response with an empty HTTP body.

## Errors
<a name="API_TagResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ServiceQuotaExceededException **   
The request would cause a service quota for the number of tags per resource to be exceeded.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 402

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_TagResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/TagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/TagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/TagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/TagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/TagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/TagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/TagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/TagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/TagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/TagResource) 

# UnlockRule
<a name="API_UnlockRule"></a>

Unlocks a retention rule. After a retention rule is unlocked, it can be modified or deleted only after the unlock delay period expires.

## Request Syntax
<a name="API_UnlockRule_RequestSyntax"></a>

```
PATCH /rules/identifier/unlock HTTP/1.1
```

## URI Request Parameters
<a name="API_UnlockRule_RequestParameters"></a>

The request uses the following URI parameters.

 ** [identifier](#API_UnlockRule_RequestSyntax) **   <a name="recyclebin-UnlockRule-request-uri-Identifier"></a>
The unique ID of the retention rule.  
Pattern: `[0-9a-zA-Z]{11}`   
Required: Yes

## Request Body
<a name="API_UnlockRule_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_UnlockRule_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "Identifier": "string",
   "LockConfiguration": { 
      "UnlockDelay": { 
         "UnlockDelayUnit": "string",
         "UnlockDelayValue": number
      }
   },
   "LockEndTime": number,
   "LockState": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   },
   "RuleArn": "string",
   "Status": "string"
}
```

## Response Elements
<a name="API_UnlockRule_ResponseElements"></a>

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

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

 ** [Description](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$` 

 ** [ExcludeResourceTags](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-ExcludeResourceTags"></a>
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.

 ** [Identifier](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-Identifier"></a>
The unique ID of the retention rule.  
Type: String  
Pattern: `[0-9a-zA-Z]{11}` 

 ** [LockConfiguration](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-LockConfiguration"></a>
Information about the retention rule lock configuration.  
Type: [LockConfiguration](API_LockConfiguration.md) object

 ** [LockEndTime](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-LockEndTime"></a>
The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.  
Type: Timestamp

 ** [LockState](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-LockState"></a>
[Region-level retention rules only] The lock state for the retention rule.  
+  `locked` - The retention rule is locked and can't be modified or deleted.
+  `pending_unlock` - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.
+  `unlocked` - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.
+  `null` - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the `locked` and `unlocked` states only; it can never transition back to `null`.
Type: String  
Valid Values: `locked | pending_unlock | unlocked` 

 ** [ResourceTags](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-ResourceTags"></a>
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [ResourceType](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-ResourceType"></a>
The resource type retained by the retention rule.  
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME` 

 ** [RetentionPeriod](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object

 ** [RuleArn](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-RuleArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$` 

 ** [Status](#API_UnlockRule_ResponseSyntax) **   <a name="recyclebin-UnlockRule-response-Status"></a>
The state of the retention rule. Only retention rules that are in the `available` state retain resources.  
Type: String  
Valid Values: `pending | available` 

## Errors
<a name="API_UnlockRule_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
The specified retention rule lock request can't be completed.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 409

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_UnlockRule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/UnlockRule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/UnlockRule) 

# UntagResource
<a name="API_UntagResource"></a>

Unassigns a tag from a retention rule.

## Request Syntax
<a name="API_UntagResource_RequestSyntax"></a>

```
DELETE /tags/resourceArn?tagKeys=TagKeys HTTP/1.1
```

## URI Request Parameters
<a name="API_UntagResource_RequestParameters"></a>

The request uses the following URI parameters.

 ** [resourceArn](#API_UntagResource_RequestSyntax) **   <a name="recyclebin-UntagResource-request-uri-ResourceArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$`   
Required: Yes

 ** [TagKeys](#API_UntagResource_RequestSyntax) **   <a name="recyclebin-UntagResource-request-uri-TagKeys"></a>
The tag keys of the tags to unassign. All tags that have the specified tag key are unassigned.  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: Yes

## Request Body
<a name="API_UntagResource_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_UntagResource_ResponseSyntax"></a>

```
HTTP/1.1 204
```

## Response Elements
<a name="API_UntagResource_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

## Errors
<a name="API_UntagResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_UntagResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/UntagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/UntagResource) 

# UpdateRule
<a name="API_UpdateRule"></a>

Updates an existing Recycle Bin retention rule. You can update a retention rule's description, resource tags, and retention period at any time after creation. You can't update a retention rule's resource type after creation. For more information, see [ Update Recycle Bin retention rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-update-rule) in the *Amazon Elastic Compute Cloud User Guide*.

## Request Syntax
<a name="API_UpdateRule_RequestSyntax"></a>

```
PATCH /rules/identifier HTTP/1.1
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   }
}
```

## URI Request Parameters
<a name="API_UpdateRule_RequestParameters"></a>

The request uses the following URI parameters.

 ** [identifier](#API_UpdateRule_RequestSyntax) **   <a name="recyclebin-UpdateRule-request-uri-Identifier"></a>
The unique ID of the retention rule.  
Pattern: `[0-9a-zA-Z]{11}`   
Required: Yes

## Request Body
<a name="API_UpdateRule_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [Description](#API_UpdateRule_RequestSyntax) **   <a name="recyclebin-UpdateRule-request-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$`   
Required: No

 ** [ExcludeResourceTags](#API_UpdateRule_RequestSyntax) **   <a name="recyclebin-UpdateRule-request-ExcludeResourceTags"></a>
[Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. Resources that have any of these tags are not retained by the retention rule upon deletion.  
You can't specify exclusion tags for tag-level retention rules.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.  
Required: No

 ** [ResourceTags](#API_UpdateRule_RequestSyntax) **   <a name="recyclebin-UpdateRule-request-ResourceTags"></a>
[Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.  
You can add the same tag key and value pair to a maximum or five retention rules.  
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Required: No

 ** [ResourceType](#API_UpdateRule_RequestSyntax) **   <a name="recyclebin-UpdateRule-request-ResourceType"></a>
This parameter is currently not supported. You can't update a retention rule's resource type after creation.
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME`   
Required: No

 ** [RetentionPeriod](#API_UpdateRule_RequestSyntax) **   <a name="recyclebin-UpdateRule-request-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object  
Required: No

## Response Syntax
<a name="API_UpdateRule_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "Description": "string",
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "Identifier": "string",
   "LockEndTime": number,
   "LockState": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string",
   "RetentionPeriod": { 
      "RetentionPeriodUnit": "string",
      "RetentionPeriodValue": number
   },
   "RuleArn": "string",
   "Status": "string"
}
```

## Response Elements
<a name="API_UpdateRule_ResponseElements"></a>

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

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

 ** [Description](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-Description"></a>
The retention rule description.  
Type: String  
Pattern: `^[\S ]{0,255}$` 

 ** [ExcludeResourceTags](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-ExcludeResourceTags"></a>
[Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 5 items.

 ** [Identifier](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-Identifier"></a>
The unique ID of the retention rule.  
Type: String  
Pattern: `[0-9a-zA-Z]{11}` 

 ** [LockEndTime](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-LockEndTime"></a>
The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.  
Type: Timestamp

 ** [LockState](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-LockState"></a>
[Region-level retention rules only] The lock state for the retention rule.  
+  `locked` - The retention rule is locked and can't be modified or deleted.
+  `pending_unlock` - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.
+  `unlocked` - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.
+  `null` - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the `locked` and `unlocked` states only; it can never transition back to `null`.
Type: String  
Valid Values: `locked | pending_unlock | unlocked` 

 ** [ResourceTags](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-ResourceTags"></a>
[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule.  
Type: Array of [ResourceTag](API_ResourceTag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 50 items.

 ** [ResourceType](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-ResourceType"></a>
The resource type retained by the retention rule.  
Type: String  
Valid Values: `EBS_SNAPSHOT | EC2_IMAGE | EBS_VOLUME` 

 ** [RetentionPeriod](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-RetentionPeriod"></a>
Information about the retention period for which the retention rule is to retain resources.  
Type: [RetentionPeriod](API_RetentionPeriod.md) object

 ** [RuleArn](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-RuleArn"></a>
The Amazon Resource Name (ARN) of the retention rule.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1011.  
Pattern: `^arn:\S+:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/[0-9a-zA-Z]{11}{0,1011}$` 

 ** [Status](#API_UpdateRule_ResponseSyntax) **   <a name="recyclebin-UpdateRule-response-Status"></a>
The state of the retention rule. Only retention rules that are in the `available` state retain resources.  
Type: String  
Valid Values: `pending | available` 

## Errors
<a name="API_UpdateRule_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
The specified retention rule lock request can't be completed.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 409

 ** InternalServerException **   
The service could not respond to the request due to an internal problem.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource was not found.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 404

 ** ServiceQuotaExceededException **   
The request would cause a service quota for the number of tags per resource to be exceeded.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 402

 ** ValidationException **   
One or more of the parameters in the request is not valid.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_UpdateRule_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/rbin-2021-06-15/UpdateRule) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/rbin-2021-06-15/UpdateRule) 