Skip to content

Commit

Permalink
feat(client-rbin): This release adds support for exclusion tags for R…
Browse files Browse the repository at this point in the history
…ecycle Bin, which allows you to identify resources that are to be excluded, or ignored, by a Region-level retention rule.
  • Loading branch information
awstools committed Nov 20, 2024
1 parent 1cc5eef commit c196753
Show file tree
Hide file tree
Showing 9 changed files with 257 additions and 53 deletions.
35 changes: 33 additions & 2 deletions clients/client-rbin/src/commands/CreateRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,27 @@ export interface CreateRuleCommandInput extends CreateRuleRequest {}
export interface CreateRuleCommandOutput extends CreateRuleResponse, __MetadataBearer {}

/**
* <p>Creates a Recycle Bin retention rule. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-create-rule">
* Create Recycle Bin retention rules</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
* <p>Creates a Recycle Bin retention rule. You can create two types of retention rules:</p>
* <ul>
* <li>
* <p>
* <b>Tag-level retention rules</b> - 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.</p>
* </li>
* <li>
* <p>
* <b>Region-level retention rules</b> - 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.</p>
* </li>
* </ul>
* <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/recycle-bin.html">
* Create Recycle Bin retention rules</a> in the <i>Amazon EBS User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -61,6 +80,12 @@ export interface CreateRuleCommandOutput extends CreateRuleResponse, __MetadataB
* UnlockDelayUnit: "DAYS", // required
* },
* },
* ExcludeResourceTags: [ // ExcludeResourceTags
* {
* ResourceTagKey: "STRING_VALUE", // required
* ResourceTagValue: "STRING_VALUE",
* },
* ],
* };
* const command = new CreateRuleCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -93,6 +118,12 @@ export interface CreateRuleCommandOutput extends CreateRuleResponse, __MetadataB
* // },
* // LockState: "locked" || "pending_unlock" || "unlocked",
* // RuleArn: "STRING_VALUE",
* // ExcludeResourceTags: [ // ExcludeResourceTags
* // {
* // ResourceTagKey: "STRING_VALUE", // required
* // ResourceTagValue: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
Expand Down
6 changes: 6 additions & 0 deletions clients/client-rbin/src/commands/GetRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export interface GetRuleCommandOutput extends GetRuleResponse, __MetadataBearer
* // LockState: "locked" || "pending_unlock" || "unlocked",
* // LockEndTime: new Date("TIMESTAMP"),
* // RuleArn: "STRING_VALUE",
* // ExcludeResourceTags: [ // ExcludeResourceTags
* // {
* // ResourceTagKey: "STRING_VALUE", // required
* // ResourceTagValue: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
Expand Down
6 changes: 6 additions & 0 deletions clients/client-rbin/src/commands/ListRulesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export interface ListRulesCommandOutput extends ListRulesResponse, __MetadataBea
* },
* ],
* LockState: "locked" || "pending_unlock" || "unlocked",
* ExcludeResourceTags: [ // ExcludeResourceTags
* {
* ResourceTagKey: "STRING_VALUE", // required
* ResourceTagValue: "STRING_VALUE",
* },
* ],
* };
* const command = new ListRulesCommand(input);
* const response = await client.send(command);
Expand Down
13 changes: 12 additions & 1 deletion clients/client-rbin/src/commands/LockRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export interface LockRuleCommandInput extends LockRuleRequest {}
export interface LockRuleCommandOutput extends LockRuleResponse, __MetadataBearer {}

/**
* <p>Locks a retention rule. A locked retention rule can't be modified or deleted.</p>
* <p>Locks a Region-level retention rule. A locked retention rule can't be modified or
* deleted.</p>
* <note>
* <p>You can't lock tag-level retention rules, or Region-level retention rules that
* have exclusion tags.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down Expand Up @@ -69,6 +74,12 @@ export interface LockRuleCommandOutput extends LockRuleResponse, __MetadataBeare
* // },
* // LockState: "locked" || "pending_unlock" || "unlocked",
* // RuleArn: "STRING_VALUE",
* // ExcludeResourceTags: [ // ExcludeResourceTags
* // {
* // ResourceTagKey: "STRING_VALUE", // required
* // ResourceTagValue: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
Expand Down
6 changes: 6 additions & 0 deletions clients/client-rbin/src/commands/UnlockRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export interface UnlockRuleCommandOutput extends UnlockRuleResponse, __MetadataB
* // LockState: "locked" || "pending_unlock" || "unlocked",
* // LockEndTime: new Date("TIMESTAMP"),
* // RuleArn: "STRING_VALUE",
* // ExcludeResourceTags: [ // ExcludeResourceTags
* // {
* // ResourceTagKey: "STRING_VALUE", // required
* // ResourceTagValue: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
Expand Down
12 changes: 12 additions & 0 deletions clients/client-rbin/src/commands/UpdateRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export interface UpdateRuleCommandOutput extends UpdateRuleResponse, __MetadataB
* ResourceTagValue: "STRING_VALUE",
* },
* ],
* ExcludeResourceTags: [ // ExcludeResourceTags
* {
* ResourceTagKey: "STRING_VALUE", // required
* ResourceTagValue: "STRING_VALUE",
* },
* ],
* };
* const command = new UpdateRuleCommand(input);
* const response = await client.send(command);
Expand All @@ -73,6 +79,12 @@ export interface UpdateRuleCommandOutput extends UpdateRuleResponse, __MetadataB
* // LockState: "locked" || "pending_unlock" || "unlocked",
* // LockEndTime: new Date("TIMESTAMP"),
* // RuleArn: "STRING_VALUE",
* // ExcludeResourceTags: [ // ExcludeResourceTags
* // {
* // ResourceTagKey: "STRING_VALUE", // required
* // ResourceTagValue: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
Expand Down
Loading

0 comments on commit c196753

Please sign in to comment.