2021/11/29 - Amazon Recycle Bin - 8 new api methods
Changes This release adds support for Recycle Bin.
Deletes a Recycle Bin retention rule. For more information, see Delete Recycle Bin retention rules in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
client.delete_rule( Identifier='string' )
string
[REQUIRED]
The unique ID of the retention rule to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Gets information about a Recycle Bin retention rule.
See also: AWS API Documentation
Request Syntax
client.get_rule( Identifier='string' )
string
[REQUIRED]
The unique ID of the retention rule.
dict
Response Syntax
{ 'Identifier': 'string', 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available' }
Response Structure
(dict) --
Identifier (string) --
The unique ID of the retention rule.
Description (string) --
The description assigned to the retention rule.
ResourceType (string) --
The resource type retained by the retention rule. Currently, only Amazon EBS snapshots are supported.
RetentionPeriod (dict) --
Information about the period for which the retention rule retains resources.
RetentionPeriodValue (integer) --
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) --
The unit of time in which the retention period is measured. Currently, only DAYS is supported.
ResourceTags (list) --
The resource tags used to identify resources that are to be retained by the retention rule.
(dict) --
Information about a resource tag used to identify resources that are to be retained by a Recycle Bin retention rule.
ResourceTagKey (string) --
The tag key.
ResourceTagValue (string) --
The tag value.
Status (string) --
The state of the retention rule. Only retention rules that are in the available state retain snapshots.
Assigns tags to the specified resource.
See also: AWS API Documentation
Request Syntax
client.tag_resource( ResourceArn='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the resource to which to assign the tags.
list
[REQUIRED]
Information about the tags to assign to the resource.
(dict) --
Information about the tags assigned to a Recycle Bin retention rule.
Key (string) -- [REQUIRED]
The tag key.
Value (string) -- [REQUIRED]
The tag value.
dict
Response Syntax
{}
Response Structure
(dict) --
Creates a Recycle Bin retention rule. For more information, see Create Recycle Bin retention rules in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
client.create_rule( RetentionPeriod={ 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, Description='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], ResourceType='EBS_SNAPSHOT', ResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] )
dict
[REQUIRED]
Information about the retention period for which the retention rule is to retain resources.
RetentionPeriodValue (integer) -- [REQUIRED]
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) -- [REQUIRED]
The unit of time in which the retention period is measured. Currently, only DAYS is supported.
string
A brief description for the retention rule.
list
Information about the tags to assign to the retention rule.
(dict) --
Information about the tags assigned to a Recycle Bin retention rule.
Key (string) -- [REQUIRED]
The tag key.
Value (string) -- [REQUIRED]
The tag value.
string
[REQUIRED]
The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots are supported.
list
Information about the resource tags to use to identify resources that are to be retained by the retention rule. The retention rule retains only deleted snapshots that have one or more of the specified tag key and value pairs. If a snapshot 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.
(dict) --
Information about a resource tag used to identify resources that are to be retained by a Recycle Bin retention rule.
ResourceTagKey (string) -- [REQUIRED]
The tag key.
ResourceTagValue (string) --
The tag value.
dict
Response Syntax
{ 'Identifier': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'Description': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ResourceType': 'EBS_SNAPSHOT', 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available' }
Response Structure
(dict) --
Identifier (string) --
The unique identifier of the retention rule.
RetentionPeriod (dict) --
Information about the retention period for which a retention rule is to retain resources.
RetentionPeriodValue (integer) --
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) --
The unit of time in which the retention period is measured. Currently, only DAYS is supported.
Description (string) --
The retention rule description.
Tags (list) --
The tags assigned to the retention rule.
(dict) --
Information about the tags assigned to a Recycle Bin retention rule.
Key (string) --
The tag key.
Value (string) --
The tag value.
ResourceType (string) --
The resource type retained by the retention rule.
ResourceTags (list) --
Information about the resource tags used to identify resources that are retained by the retention rule.
(dict) --
Information about a resource tag used to identify resources that are to be retained by a Recycle Bin retention rule.
ResourceTagKey (string) --
The tag key.
ResourceTagValue (string) --
The tag value.
Status (string) --
The state of the retention rule. Only retention rules that are in the available state retain snapshots.
Lists the Recycle Bin retention rules in the Region.
See also: AWS API Documentation
Request Syntax
client.list_rules( MaxResults=123, NextToken='string', ResourceType='EBS_SNAPSHOT', ResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] )
integer
The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value. This value can be between 5 and 500. If maxResults is given a larger value than 500, you receive an error.
string
The token to use to retrieve the next page of results.
string
[REQUIRED]
The resource type retained by the retention rule. Only retention rules that retain the specified resource type are listed.
list
The tags used to identify resources that are to be retained by the retention rule.
(dict) --
Information about a resource tag used to identify resources that are to be retained by a Recycle Bin retention rule.
ResourceTagKey (string) -- [REQUIRED]
The tag key.
ResourceTagValue (string) --
The tag value.
dict
Response Syntax
{ 'Rules': [ { 'Identifier': 'string', 'Description': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Rules (list) --
Information about the retention rules.
(dict) --
Information about a Recycle Bin retention rule.
Identifier (string) --
The unique ID of the retention rule.
Description (string) --
The description for the retention rule.
RetentionPeriod (dict) --
Information about the retention period for which the retention rule retains resources
RetentionPeriodValue (integer) --
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) --
The unit of time in which the retention period is measured. Currently, only DAYS is supported.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
Unassigns a tag from a resource.
See also: AWS API Documentation
Request Syntax
client.untag_resource( ResourceArn='string', TagKeys=[ 'string', ] )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the resource from which to unassign the tags.
list
[REQUIRED]
Information about the tags to unassign from the resource.
(string) --
dict
Response Syntax
{}
Response Structure
(dict) --
Lists the tags assigned a specific resource.
See also: AWS API Documentation
Request Syntax
client.list_tags_for_resource( ResourceArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the resource for which to list the tags.
dict
Response Syntax
{ 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }
Response Structure
(dict) --
Tags (list) --
Information about the tags assigned to the resource.
(dict) --
Information about the tags assigned to a Recycle Bin retention rule.
Key (string) --
The tag key.
Value (string) --
The tag value.
Updates an existing Recycle Bin retention rule. For more information, see Update Recycle Bin retention rules in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
client.update_rule( Identifier='string', RetentionPeriod={ 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, Description='string', ResourceType='EBS_SNAPSHOT', ResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] )
string
[REQUIRED]
The unique ID of the retention rule to update.
dict
Information about the retention period for which the retention rule is to retain resources.
RetentionPeriodValue (integer) -- [REQUIRED]
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) -- [REQUIRED]
The unit of time in which the retention period is measured. Currently, only DAYS is supported.
string
The retention rule description.
string
The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots are supported.
list
Information about the resource tags to use to identify resources that are to be retained by the retention rule. The retention rule retains only deleted snapshots that have one or more of the specified tag key and value pairs. If a snapshot 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.
(dict) --
Information about a resource tag used to identify resources that are to be retained by a Recycle Bin retention rule.
ResourceTagKey (string) -- [REQUIRED]
The tag key.
ResourceTagValue (string) --
The tag value.
dict
Response Syntax
{ 'Identifier': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT', 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available' }
Response Structure
(dict) --
Identifier (string) --
The unique ID of the retention rule.
RetentionPeriod (dict) --
Information about the retention period for which a retention rule is to retain resources.
RetentionPeriodValue (integer) --
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RetentionPeriodUnit (string) --
The unit of time in which the retention period is measured. Currently, only DAYS is supported.
Description (string) --
The retention rule description.
ResourceType (string) --
The resource type retained by the retention rule.
ResourceTags (list) --
Information about the resource tags used to identify resources that are retained by the retention rule.
(dict) --
Information about a resource tag used to identify resources that are to be retained by a Recycle Bin retention rule.
ResourceTagKey (string) --
The tag key.
ResourceTagValue (string) --
The tag value.
Status (string) --
The state of the retention rule. Only retention rules that are in the available state retain snapshots.