v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-14105855.2 KB

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 in the Amazon EBS User Guide.

post/rules

Request body

Descriptionstring

The retention rule description.

ResourceType'EBS_SNAPSHOT' | 'EC2_IMAGE' | 'EBS_VOLUME' required
<p>The resource type to be retained by the retention rule. Currently, only EBS volumes, EBS snapshots, and EBS-backed AMIs are supported.</p> <ul> <li> <p>To retain EBS volumes, specify <code>EBS_VOLUME</code>.</p> </li> <li> <p>To retain EBS snapshots, specify <code>EBS_SNAPSHOT</code> </p> </li> <li> <p>To retain EBS-backed AMIs, specify <code>EC2_IMAGE</code>.</p> </li> </ul>

Response

Success

Identifierstring

The unique ID of the retention rule.

Descriptionstring

The retention rule description.

ResourceType'EBS_SNAPSHOT' | 'EC2_IMAGE' | 'EBS_VOLUME'

The resource type retained by the retention rule.

Status'pending' | 'available'

The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.

LockState'locked' | 'pending_unlock' | 'unlocked'
<p>[Region-level retention rules only] The lock state for the retention rule.</p> <ul> <li> <p> <code>locked</code> - The retention rule is locked and can't be modified or deleted.</p> </li> <li> <p> <code>pending_unlock</code> - 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.</p> </li> <li> <p> <code>unlocked</code> - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.</p> </li> <li> <p> <code>null</code> - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the <code>locked</code> and <code>unlocked</code> states only; it can never transition back to <code>null</code>.</p> </li> </ul>
RuleArnstring

The Amazon Resource Name (ARN) of the retention rule.

All 10 operations