From 98e1d9fbaafa6d7f930073a0e4fac988dd9355ee Mon Sep 17 00:00:00 2001 From: awstools Date: Wed, 3 Apr 2024 18:16:21 +0000 Subject: [PATCH] feat(client-cloudformation): This release would return a new field - PolicyAction in cloudformation's existed DescribeChangeSetResponse, showing actions we are going to apply on the physical resource (e.g., Delete, Retain) according to the user's template --- .../src/commands/ActivateTypeCommand.ts | 2 +- .../BatchDescribeTypeConfigurationsCommand.ts | 2 +- .../src/commands/DescribeChangeSetCommand.ts | 1 + .../src/commands/RegisterTypeCommand.ts | 2 +- .../commands/SetTypeConfigurationCommand.ts | 2 +- .../commands/SetTypeDefaultVersionCommand.ts | 3 +- .../src/models/models_0.ts | 87 +++++++++++-------- .../src/models/models_1.ts | 34 ++++++++ .../src/protocols/Aws_query.ts | 6 +- .../aws-models/cloudformation.json | 59 +++++++++++-- 10 files changed, 150 insertions(+), 48 deletions(-) diff --git a/clients/client-cloudformation/src/commands/ActivateTypeCommand.ts b/clients/client-cloudformation/src/commands/ActivateTypeCommand.ts index 57b3db6c1019..813747004638 100644 --- a/clients/client-cloudformation/src/commands/ActivateTypeCommand.ts +++ b/clients/client-cloudformation/src/commands/ActivateTypeCommand.ts @@ -31,7 +31,7 @@ export interface ActivateTypeCommandOutput extends ActivateTypeOutput, __Metadat * see Using public * extensions in the CloudFormation User Guide.

*

Once you have activated a public third-party extension in your account and Region, use SetTypeConfiguration to specify configuration properties for the extension. For more information, see - * Configuring extensions at + * Configuring extensions at * the account level in the CloudFormation User Guide.

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-cloudformation/src/commands/BatchDescribeTypeConfigurationsCommand.ts b/clients/client-cloudformation/src/commands/BatchDescribeTypeConfigurationsCommand.ts index 2e742b8530bc..d1a682e784f6 100644 --- a/clients/client-cloudformation/src/commands/BatchDescribeTypeConfigurationsCommand.ts +++ b/clients/client-cloudformation/src/commands/BatchDescribeTypeConfigurationsCommand.ts @@ -34,7 +34,7 @@ export interface BatchDescribeTypeConfigurationsCommandOutput /** *

Returns configuration data for the specified CloudFormation extensions, from the CloudFormation registry * for the account and Region.

- *

For more information, see Configuring extensions at + *

For more information, see Configuring extensions at * the account level in the CloudFormation User Guide.

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-cloudformation/src/commands/DescribeChangeSetCommand.ts b/clients/client-cloudformation/src/commands/DescribeChangeSetCommand.ts index aa8593beec2b..8067162e54df 100644 --- a/clients/client-cloudformation/src/commands/DescribeChangeSetCommand.ts +++ b/clients/client-cloudformation/src/commands/DescribeChangeSetCommand.ts @@ -87,6 +87,7 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetOutput, * // Type: "Resource", * // HookInvocationCount: Number("int"), * // ResourceChange: { // ResourceChange + * // PolicyAction: "Delete" || "Retain" || "Snapshot" || "ReplaceAndDelete" || "ReplaceAndRetain" || "ReplaceAndSnapshot", * // Action: "Add" || "Modify" || "Remove" || "Import" || "Dynamic", * // LogicalResourceId: "STRING_VALUE", * // PhysicalResourceId: "STRING_VALUE", diff --git a/clients/client-cloudformation/src/commands/RegisterTypeCommand.ts b/clients/client-cloudformation/src/commands/RegisterTypeCommand.ts index cea95f387b06..93c9f712b4f8 100644 --- a/clients/client-cloudformation/src/commands/RegisterTypeCommand.ts +++ b/clients/client-cloudformation/src/commands/RegisterTypeCommand.ts @@ -46,7 +46,7 @@ export interface RegisterTypeCommandOutput extends RegisterTypeOutput, __Metadat * per Region. Use DeregisterType to deregister specific extension versions if necessary.

*

Once you have initiated a registration request using RegisterType, you can use DescribeTypeRegistration to monitor the progress of the registration request.

*

Once you have registered a private extension in your account and Region, use SetTypeConfiguration to specify - * configuration properties for the extension. For more information, see Configuring extensions at + * configuration properties for the extension. For more information, see Configuring extensions at * the account level in the CloudFormation User Guide.

* @example * Use a bare-bones client and the command you need to make an API call. diff --git a/clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts b/clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts index 0f940c5caddc..dff6a487e2a2 100644 --- a/clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts +++ b/clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts @@ -29,7 +29,7 @@ export interface SetTypeConfigurationCommandOutput extends SetTypeConfigurationO /** *

Specifies the configuration data for a registered CloudFormation extension, in the given account and Region.

*

To view the current configuration data for an extension, refer to the ConfigurationSchema element - * of DescribeType. For more information, see Configuring extensions at + * of DescribeType. For more information, see Configuring extensions at * the account level in the CloudFormation User Guide.

* *

It's strongly recommended that you use dynamic references to restrict sensitive configuration definitions, such diff --git a/clients/client-cloudformation/src/commands/SetTypeDefaultVersionCommand.ts b/clients/client-cloudformation/src/commands/SetTypeDefaultVersionCommand.ts index 9281f0763fec..27c948cd8e32 100644 --- a/clients/client-cloudformation/src/commands/SetTypeDefaultVersionCommand.ts +++ b/clients/client-cloudformation/src/commands/SetTypeDefaultVersionCommand.ts @@ -6,8 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient"; import { commonParams } from "../endpoint/EndpointParameters"; -import { SetTypeDefaultVersionInput } from "../models/models_0"; -import { SetTypeDefaultVersionOutput } from "../models/models_1"; +import { SetTypeDefaultVersionInput, SetTypeDefaultVersionOutput } from "../models/models_1"; import { de_SetTypeDefaultVersionCommand, se_SetTypeDefaultVersionCommand } from "../protocols/Aws_query"; /** diff --git a/clients/client-cloudformation/src/models/models_0.ts b/clients/client-cloudformation/src/models/models_0.ts index 6065996c6508..82cdc2561191 100644 --- a/clients/client-cloudformation/src/models/models_0.ts +++ b/clients/client-cloudformation/src/models/models_0.ts @@ -510,7 +510,7 @@ export interface BatchDescribeTypeConfigurationsError { /** *

Detailed information concerning the specification of a CloudFormation extension in a given account and * Region.

- *

For more information, see Configuring extensions at + *

For more information, see Configuring extensions at * the account level in the CloudFormation User Guide.

* @public */ @@ -932,6 +932,24 @@ export interface ModuleInfo { LogicalIdHierarchy?: string; } +/** + * @public + * @enum + */ +export const PolicyAction = { + Delete: "Delete", + ReplaceAndDelete: "ReplaceAndDelete", + ReplaceAndRetain: "ReplaceAndRetain", + ReplaceAndSnapshot: "ReplaceAndSnapshot", + Retain: "Retain", + Snapshot: "Snapshot", +} as const; + +/** + * @public + */ +export type PolicyAction = (typeof PolicyAction)[keyof typeof PolicyAction]; + /** * @public * @enum @@ -953,6 +971,38 @@ export type Replacement = (typeof Replacement)[keyof typeof Replacement]; * @public */ export interface ResourceChange { + /** + *

The action that will be taken on the physical resource when the change set is executed.

+ * + * @public + */ + PolicyAction?: PolicyAction; + /** *

The action that CloudFormation takes on the resource, such as Add (adds a new resource), Modify * (changes a resource), Remove (deletes a resource), Import (imports a resource), or @@ -7051,7 +7101,7 @@ export interface DescribeTypeOutput { /** *

A JSON string that represent the current configuration data for the extension in this account and Region.

*

To set the configuration data for an extension, use SetTypeConfiguration. For more - * information, see Configuring extensions at + * information, see Configuring extensions at * the account level in the CloudFormation User Guide.

* @public */ @@ -10878,36 +10928,3 @@ export interface SetTypeConfigurationOutput { */ ConfigurationArn?: string; } - -/** - * @public - */ -export interface SetTypeDefaultVersionInput { - /** - *

The Amazon Resource Name (ARN) of the extension for which you want version summary information.

- *

Conditional: You must specify either TypeName and Type, or Arn.

- * @public - */ - Arn?: string; - - /** - *

The kind of extension.

- *

Conditional: You must specify either TypeName and Type, or Arn.

- * @public - */ - Type?: RegistryType; - - /** - *

The name of the extension.

- *

Conditional: You must specify either TypeName and Type, or Arn.

- * @public - */ - TypeName?: string; - - /** - *

The ID of a specific version of the extension. The version ID is the value at the end of the Amazon Resource - * Name (ARN) assigned to the extension version when it is registered.

- * @public - */ - VersionId?: string; -} diff --git a/clients/client-cloudformation/src/models/models_1.ts b/clients/client-cloudformation/src/models/models_1.ts index 0a914ebb9a39..4dba8d9b1bdd 100644 --- a/clients/client-cloudformation/src/models/models_1.ts +++ b/clients/client-cloudformation/src/models/models_1.ts @@ -11,6 +11,7 @@ import { ManagedExecution, Parameter, PermissionModels, + RegistryType, ResourceDefinition, RollbackConfiguration, StackSetOperationPreferences, @@ -19,6 +20,39 @@ import { ThirdPartyType, } from "./models_0"; +/** + * @public + */ +export interface SetTypeDefaultVersionInput { + /** + *

The Amazon Resource Name (ARN) of the extension for which you want version summary information.

+ *

Conditional: You must specify either TypeName and Type, or Arn.

+ * @public + */ + Arn?: string; + + /** + *

The kind of extension.

+ *

Conditional: You must specify either TypeName and Type, or Arn.

+ * @public + */ + Type?: RegistryType; + + /** + *

The name of the extension.

+ *

Conditional: You must specify either TypeName and Type, or Arn.

+ * @public + */ + TypeName?: string; + + /** + *

The ID of a specific version of the extension. The version ID is the value at the end of the Amazon Resource + * Name (ARN) assigned to the extension version when it is registered.

+ * @public + */ + VersionId?: string; +} + /** * @public */ diff --git a/clients/client-cloudformation/src/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts index 9eb27521b2fc..7632b66cb154 100644 --- a/clients/client-cloudformation/src/protocols/Aws_query.ts +++ b/clients/client-cloudformation/src/protocols/Aws_query.ts @@ -421,7 +421,6 @@ import { SetStackPolicyInput, SetTypeConfigurationInput, SetTypeConfigurationOutput, - SetTypeDefaultVersionInput, Stack, StackDriftInformation, StackDriftInformationSummary, @@ -474,6 +473,7 @@ import { } from "../models/models_0"; import { ResourceScanLimitExceededException, + SetTypeDefaultVersionInput, SetTypeDefaultVersionOutput, SignalResourceInput, StartResourceScanInput, @@ -9018,6 +9018,9 @@ const de_RequiredActivatedTypes = (output: any, context: __SerdeContext): Requir */ const de_ResourceChange = (output: any, context: __SerdeContext): ResourceChange => { const contents: any = {}; + if (output[_PA] != null) { + contents[_PA] = __expectString(output[_PA]); + } if (output[_A] != null) { contents[_A] = __expectString(output[_A]); } @@ -11258,6 +11261,7 @@ const _OUI = "OrganizationalUnitIds"; const _OUIr = "OrganizationalUnitId"; const _OV = "OutputValue"; const _P = "Parameters"; +const _PA = "PolicyAction"; const _PC = "PercentageCompleted"; const _PCSI = "ParentChangeSetId"; const _PCa = "ParameterConstraints"; diff --git a/codegen/sdk-codegen/aws-models/cloudformation.json b/codegen/sdk-codegen/aws-models/cloudformation.json index 98afba35d088..0b98e80baf2c 100644 --- a/codegen/sdk-codegen/aws-models/cloudformation.json +++ b/codegen/sdk-codegen/aws-models/cloudformation.json @@ -206,7 +206,7 @@ } ], "traits": { - "smithy.api#documentation": "

Activates a public third-party extension, making it available for use in stack templates. For more information,\n see Using public\n extensions in the CloudFormation User Guide.

\n

Once you have activated a public third-party extension in your account and Region, use SetTypeConfiguration to specify configuration properties for the extension. For more information, see\n Configuring extensions at\n the account level in the CloudFormation User Guide.

", + "smithy.api#documentation": "

Activates a public third-party extension, making it available for use in stack templates. For more information,\n see Using public\n extensions in the CloudFormation User Guide.

\n

Once you have activated a public third-party extension in your account and Region, use SetTypeConfiguration to specify configuration properties for the extension. For more information, see\n Configuring extensions at\n the account level in the CloudFormation User Guide.

", "smithy.api#idempotent": {} } }, @@ -364,7 +364,7 @@ } ], "traits": { - "smithy.api#documentation": "

Returns configuration data for the specified CloudFormation extensions, from the CloudFormation registry\n for the account and Region.

\n

For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

" + "smithy.api#documentation": "

Returns configuration data for the specified CloudFormation extensions, from the CloudFormation registry\n for the account and Region.

\n

For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

" } }, "com.amazonaws.cloudformation#BatchDescribeTypeConfigurationsError": { @@ -5537,7 +5537,7 @@ "ConfigurationSchema": { "target": "com.amazonaws.cloudformation#ConfigurationSchema", "traits": { - "smithy.api#documentation": "

A JSON string that represent the current configuration data for the extension in this account and Region.

\n

To set the configuration data for an extension, use SetTypeConfiguration. For more\n information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

" + "smithy.api#documentation": "

A JSON string that represent the current configuration data for the extension in this account and Region.

\n

To set the configuration data for an extension, use SetTypeConfiguration. For more\n information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

" } }, "PublisherId": { @@ -9346,6 +9346,47 @@ "smithy.api#documentation": "

Context information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in\n cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context\n key-value pair specifies a resource that contains the targeted resource.

" } }, + "com.amazonaws.cloudformation#PolicyAction": { + "type": "enum", + "members": { + "Delete": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Delete" + } + }, + "Retain": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Retain" + } + }, + "Snapshot": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Snapshot" + } + }, + "ReplaceAndDelete": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ReplaceAndDelete" + } + }, + "ReplaceAndRetain": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ReplaceAndRetain" + } + }, + "ReplaceAndSnapshot": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ReplaceAndSnapshot" + } + } + } + }, "com.amazonaws.cloudformation#PrivateTypeArn": { "type": "string", "traits": { @@ -9746,7 +9787,7 @@ } ], "traits": { - "smithy.api#documentation": "

Registers an extension with the CloudFormation service. Registering an extension makes it available for use in\n CloudFormation templates in your Amazon Web Services account, and includes:

\n \n

For more information about how to develop extensions and ready them for registration, see Creating Resource\n Providers in the CloudFormation CLI User Guide.

\n

You can have a maximum of 50 resource extension versions registered at a time. This maximum is per account and\n per Region. Use DeregisterType to deregister specific extension versions if necessary.

\n

Once you have initiated a registration request using RegisterType, you can use DescribeTypeRegistration to monitor the progress of the registration request.

\n

Once you have registered a private extension in your account and Region, use SetTypeConfiguration to specify\n configuration properties for the extension. For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

", + "smithy.api#documentation": "

Registers an extension with the CloudFormation service. Registering an extension makes it available for use in\n CloudFormation templates in your Amazon Web Services account, and includes:

\n \n

For more information about how to develop extensions and ready them for registration, see Creating Resource\n Providers in the CloudFormation CLI User Guide.

\n

You can have a maximum of 50 resource extension versions registered at a time. This maximum is per account and\n per Region. Use DeregisterType to deregister specific extension versions if necessary.

\n

Once you have initiated a registration request using RegisterType, you can use DescribeTypeRegistration to monitor the progress of the registration request.

\n

Once you have registered a private extension in your account and Region, use SetTypeConfiguration to specify\n configuration properties for the extension. For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

", "smithy.api#idempotent": {} } }, @@ -10027,6 +10068,12 @@ "com.amazonaws.cloudformation#ResourceChange": { "type": "structure", "members": { + "PolicyAction": { + "target": "com.amazonaws.cloudformation#PolicyAction", + "traits": { + "smithy.api#documentation": "

The action that will be taken on the physical resource when the change set is executed.

\n " + } + }, "Action": { "target": "com.amazonaws.cloudformation#ChangeAction", "traits": { @@ -11054,7 +11101,7 @@ } ], "traits": { - "smithy.api#documentation": "

Specifies the configuration data for a registered CloudFormation extension, in the given account and Region.

\n

To view the current configuration data for an extension, refer to the ConfigurationSchema element\n of DescribeType. For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

\n \n

It's strongly recommended that you use dynamic references to restrict sensitive configuration definitions, such\n as third-party credentials. For more details on dynamic references, see Using\n dynamic references to specify template values in the CloudFormation User Guide.

\n
" + "smithy.api#documentation": "

Specifies the configuration data for a registered CloudFormation extension, in the given account and Region.

\n

To view the current configuration data for an extension, refer to the ConfigurationSchema element\n of DescribeType. For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

\n \n

It's strongly recommended that you use dynamic references to restrict sensitive configuration definitions, such\n as third-party credentials. For more details on dynamic references, see Using\n dynamic references to specify template values in the CloudFormation User Guide.

\n
" } }, "com.amazonaws.cloudformation#SetTypeConfigurationInput": { @@ -14220,7 +14267,7 @@ } }, "traits": { - "smithy.api#documentation": "

Detailed information concerning the specification of a CloudFormation extension in a given account and\n Region.

\n

For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

" + "smithy.api#documentation": "

Detailed information concerning the specification of a CloudFormation extension in a given account and\n Region.

\n

For more information, see Configuring extensions at\n the account level in the CloudFormation User Guide.

" } }, "com.amazonaws.cloudformation#TypeConfigurationDetailsList": {