From c19675373f935701c5bd7cecac71f158b8868a26 Mon Sep 17 00:00:00 2001 From: awstools Date: Wed, 20 Nov 2024 19:12:54 +0000 Subject: [PATCH] feat(client-rbin): This release adds support for exclusion tags for Recycle Bin, which allows you to identify resources that are to be excluded, or ignored, by a Region-level retention rule. --- .../src/commands/CreateRuleCommand.ts | 35 ++++- .../src/commands/GetRuleCommand.ts | 6 + .../src/commands/ListRulesCommand.ts | 6 + .../src/commands/LockRuleCommand.ts | 13 +- .../src/commands/UnlockRuleCommand.ts | 6 + .../src/commands/UpdateRuleCommand.ts | 12 ++ clients/client-rbin/src/models/models_0.ts | 126 +++++++++++++----- .../src/protocols/Aws_restJson1.ts | 12 ++ codegen/sdk-codegen/aws-models/rbin.json | 94 ++++++++++--- 9 files changed, 257 insertions(+), 53 deletions(-) diff --git a/clients/client-rbin/src/commands/CreateRuleCommand.ts b/clients/client-rbin/src/commands/CreateRuleCommand.ts index a20c28d740d7..6d09b9cd38da 100644 --- a/clients/client-rbin/src/commands/CreateRuleCommand.ts +++ b/clients/client-rbin/src/commands/CreateRuleCommand.ts @@ -28,8 +28,27 @@ export interface CreateRuleCommandInput extends CreateRuleRequest {} export interface CreateRuleCommandOutput extends CreateRuleResponse, __MetadataBearer {} /** - *

Creates a Recycle Bin retention rule. For more information, see - * Create Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.

+ *

Creates a Recycle Bin retention rule. You can create two types of retention rules:

+ * + *

For more information, see + * Create Recycle Bin retention rules in the Amazon EBS User Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript @@ -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); @@ -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", + * // }, + * // ], * // }; * * ``` diff --git a/clients/client-rbin/src/commands/GetRuleCommand.ts b/clients/client-rbin/src/commands/GetRuleCommand.ts index ac454c90c2d1..40e2bd14b7f3 100644 --- a/clients/client-rbin/src/commands/GetRuleCommand.ts +++ b/clients/client-rbin/src/commands/GetRuleCommand.ts @@ -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", + * // }, + * // ], * // }; * * ``` diff --git a/clients/client-rbin/src/commands/ListRulesCommand.ts b/clients/client-rbin/src/commands/ListRulesCommand.ts index b9f10da0d300..39ee4197dca8 100644 --- a/clients/client-rbin/src/commands/ListRulesCommand.ts +++ b/clients/client-rbin/src/commands/ListRulesCommand.ts @@ -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); diff --git a/clients/client-rbin/src/commands/LockRuleCommand.ts b/clients/client-rbin/src/commands/LockRuleCommand.ts index 3647aa53c901..fbc2fd7ca419 100644 --- a/clients/client-rbin/src/commands/LockRuleCommand.ts +++ b/clients/client-rbin/src/commands/LockRuleCommand.ts @@ -28,7 +28,12 @@ export interface LockRuleCommandInput extends LockRuleRequest {} export interface LockRuleCommandOutput extends LockRuleResponse, __MetadataBearer {} /** - *

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

+ *

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

+ * + *

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

+ *
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript @@ -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", + * // }, + * // ], * // }; * * ``` diff --git a/clients/client-rbin/src/commands/UnlockRuleCommand.ts b/clients/client-rbin/src/commands/UnlockRuleCommand.ts index 213a53b8bb85..3ccf6de9668b 100644 --- a/clients/client-rbin/src/commands/UnlockRuleCommand.ts +++ b/clients/client-rbin/src/commands/UnlockRuleCommand.ts @@ -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", + * // }, + * // ], * // }; * * ``` diff --git a/clients/client-rbin/src/commands/UpdateRuleCommand.ts b/clients/client-rbin/src/commands/UpdateRuleCommand.ts index 9d5661bcd3ec..509553c6b1a0 100644 --- a/clients/client-rbin/src/commands/UpdateRuleCommand.ts +++ b/clients/client-rbin/src/commands/UpdateRuleCommand.ts @@ -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); @@ -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", + * // }, + * // ], * // }; * * ``` diff --git a/clients/client-rbin/src/models/models_0.ts b/clients/client-rbin/src/models/models_0.ts index 8535150537a9..fbe3c5efa2da 100644 --- a/clients/client-rbin/src/models/models_0.ts +++ b/clients/client-rbin/src/models/models_0.ts @@ -3,6 +3,25 @@ import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-cli import { RbinServiceException as __BaseException } from "./RbinServiceException"; +/** + *

[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention + * rule.

+ * @public + */ +export interface ResourceTag { + /** + *

The tag key.

+ * @public + */ + ResourceTagKey: string | undefined; + + /** + *

The tag value.

+ * @public + */ + ResourceTagValue?: string | undefined; +} + /** * @public * @enum @@ -50,25 +69,6 @@ export interface LockConfiguration { UnlockDelay: UnlockDelay | undefined; } -/** - *

Information about the resource tags used to identify resources that are retained by the retention - * rule.

- * @public - */ -export interface ResourceTag { - /** - *

The tag key.

- * @public - */ - ResourceTagKey: string | undefined; - - /** - *

The tag value.

- * @public - */ - ResourceTagValue?: string | undefined; -} - /** * @public * @enum @@ -165,7 +165,7 @@ export interface CreateRuleRequest { ResourceType: ResourceType | undefined; /** - *

Specifies the resource tags to use to identify resources that are to be retained by 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.

@@ -182,6 +182,15 @@ export interface CreateRuleRequest { * @public */ LockConfiguration?: LockConfiguration | undefined; + + /** + *

[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.

+ * @public + */ + ExcludeResourceTags?: ResourceTag[] | undefined; } /** @@ -248,7 +257,7 @@ export interface CreateRuleResponse { ResourceType?: ResourceType | undefined; /** - *

Information about the resource tags used to identify resources that are retained by the retention + *

[Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention * rule.

* @public */ @@ -268,7 +277,7 @@ export interface CreateRuleResponse { LockConfiguration?: LockConfiguration | undefined; /** - *

The lock state for the retention rule.

+ *

[Region-level retention rules only] The lock state for the retention rule.

*