For more information about using this API in one of the language-specific AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
UntagResource
UntagResource
Unassigns a tag from a retention rule.
Request Syntax
DELETE /tags/resourceArn?tagKeys=TagKeys HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
resourceArn (p. 19)
The Amazon Resource Name (ARN) of the retention rule.
Length Constraints: Minimum length of 0. Maximum length of 1011.
Pattern: ^arn:aws(-[a-z]{1,3}){0,2}:rbin:[a-z\-0-9]{0,63}:[0-9]{12}:rule/
[0-9a-zA-Z]{11}{0,1011}$
Required: Yes TagKeys (p. 19)
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
The request does not have a request body.
Response Syntax
HTTP/1.1 204
Response Elements
If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors (p. 32).
InternalServerException
The service could not respond to the request due to an internal problem.
See Also
HTTP Status Code: 500 ResourceNotFoundException
The specified resource was not found.
HTTP Status Code: 404 ValidationException
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 AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
UpdateRule
UpdateRule
Updates an existing Recycle Bin retention rule. For more information, see Update Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.
Request Syntax
PATCH /rules/identifier HTTP/1.1 Content-type: application/json { "Description": "string", "ResourceTags": [
"ResourceType": "string", "RetentionPeriod": {
"RetentionPeriodUnit": "string", "RetentionPeriodValue": number }
}
URI Request Parameters
The request uses the following URI parameters.
identifier (p. 21)
The unique ID of the retention rule.
Pattern: [0-9a-zA-Z]{11}
Required: Yes
Request Body
The request accepts the following data in JSON format.
Description (p. 21)
The retention rule description.
Type: String
Pattern: ^[\S ]{0,255}$
Required: No ResourceTags (p. 21)
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,
Response Syntax
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 (p. 26) objects
Array Members: Minimum number of 0 items. Maximum number of 50 items.
Required: No ResourceType (p. 21)
The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify EC2_IMAGE.
Type: String
Valid Values: EBS_SNAPSHOT | EC2_IMAGE Required: No
RetentionPeriod (p. 21)
Information about the retention period for which the retention rule is to retain resources.
Type: RetentionPeriod (p. 27) object Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json {
"Description": "string", "Identifier": "string", "ResourceTags": [
"ResourceType": "string", "RetentionPeriod": {
"RetentionPeriodUnit": "string", "RetentionPeriodValue": number },
"Status": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
Errors
The following data is returned in JSON format by the service.
Description (p. 22)
The retention rule description.
Type: String
Pattern: ^[\S ]{0,255}$
Identifier (p. 22)
The unique ID of the retention rule.
Type: String
Pattern: [0-9a-zA-Z]{11}
ResourceTags (p. 22)
Information about the resource tags used to identify resources that are retained by the retention rule.
Type: Array of ResourceTag (p. 26) objects
Array Members: Minimum number of 0 items. Maximum number of 50 items.
ResourceType (p. 22)
The resource type retained by the retention rule.
Type: String
Valid Values: EBS_SNAPSHOT | EC2_IMAGE RetentionPeriod (p. 22)
Information about the retention period for which the retention rule is to retain resources.
Type: RetentionPeriod (p. 27) object Status (p. 22)
The state of the retention rule. Only retention rules that are in the available state retain resources.
Type: String
Valid Values: pending | available
Errors
For information about the errors that are common to all actions, see Common Errors (p. 32).
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.
HTTP Status Code: 404
See Also
ValidationException
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 AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3