Skip to content

Commit

Permalink
feat(client-cloudformation): This release would return a new field - …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
awstools committed Apr 3, 2024
1 parent 21c6b46 commit 98e1d9f
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ActivateTypeCommandOutput extends ActivateTypeOutput, __Metadat
* see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html">Using public
* extensions</a> in the <i>CloudFormation User Guide</i>.</p>
* <p>Once you have activated a public third-party extension in your account and Region, use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetTypeConfiguration.html">SetTypeConfiguration</a> to specify configuration properties for the extension. For more information, see
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration">Configuring extensions at
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring extensions at
* the account level</a> in the <i>CloudFormation User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface BatchDescribeTypeConfigurationsCommandOutput
/**
* <p>Returns configuration data for the specified CloudFormation extensions, from the CloudFormation registry
* for the account and Region.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration">Configuring extensions at
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring extensions at
* the account level</a> in the <i>CloudFormation User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface RegisterTypeCommandOutput extends RegisterTypeOutput, __Metadat
* per Region. Use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeregisterType.html">DeregisterType</a> to deregister specific extension versions if necessary.</p>
* <p>Once you have initiated a registration request using <a>RegisterType</a>, you can use <a>DescribeTypeRegistration</a> to monitor the progress of the registration request.</p>
* <p>Once you have registered a private extension in your account and Region, use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetTypeConfiguration.html">SetTypeConfiguration</a> to specify
* configuration properties for the extension. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration">Configuring extensions at
* configuration properties for the extension. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring extensions at
* the account level</a> in the <i>CloudFormation User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface SetTypeConfigurationCommandOutput extends SetTypeConfigurationO
/**
* <p>Specifies the configuration data for a registered CloudFormation extension, in the given account and Region.</p>
* <p>To view the current configuration data for an extension, refer to the <code>ConfigurationSchema</code> element
* of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration">Configuring extensions at
* of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring extensions at
* the account level</a> in the <i>CloudFormation User Guide</i>.</p>
* <important>
* <p>It's strongly recommended that you use dynamic references to restrict sensitive configuration definitions, such
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
87 changes: 52 additions & 35 deletions clients/client-cloudformation/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export interface BatchDescribeTypeConfigurationsError {
/**
* <p>Detailed information concerning the specification of a CloudFormation extension in a given account and
* Region.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration">Configuring extensions at
* <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring extensions at
* the account level</a> in the <i>CloudFormation User Guide</i>.</p>
* @public
*/
Expand Down Expand Up @@ -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
Expand All @@ -953,6 +971,38 @@ export type Replacement = (typeof Replacement)[keyof typeof Replacement];
* @public
*/
export interface ResourceChange {
/**
* <p>The action that will be taken on the physical resource when the change set is executed.</p>
* <ul>
* <li>
* <p>
* <code>Delete</code> The resource will be deleted.</p>
* </li>
* <li>
* <p>
* <code>Retain</code> The resource will be retained.</p>
* </li>
* <li>
* <p>
* <code>Snapshot</code> The resource will have a snapshot taken.</p>
* </li>
* <li>
* <p>
* <code>ReplaceAndDelete</code> The resource will be replaced and then deleted.</p>
* </li>
* <li>
* <p>
* <code>ReplaceAndRetain</code> The resource will be replaced and then retained.</p>
* </li>
* <li>
* <p>
* <code>ReplaceAndSnapshot</code> The resource will be replaced and then have a snapshot taken.</p>
* </li>
* </ul>
* @public
*/
PolicyAction?: PolicyAction;

/**
* <p>The action that CloudFormation takes on the resource, such as <code>Add</code> (adds a new resource), <code>Modify</code>
* (changes a resource), <code>Remove</code> (deletes a resource), <code>Import</code> (imports a resource), or
Expand Down Expand Up @@ -7051,7 +7101,7 @@ export interface DescribeTypeOutput {
/**
* <p>A JSON string that represent the current configuration data for the extension in this account and Region.</p>
* <p>To set the configuration data for an extension, use <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetTypeConfiguration.html">SetTypeConfiguration</a>. For more
* information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration">Configuring extensions at
* information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring extensions at
* the account level</a> in the <i>CloudFormation User Guide</i>.</p>
* @public
*/
Expand Down Expand Up @@ -10878,36 +10928,3 @@ export interface SetTypeConfigurationOutput {
*/
ConfigurationArn?: string;
}

/**
* @public
*/
export interface SetTypeDefaultVersionInput {
/**
* <p>The Amazon Resource Name (ARN) of the extension for which you want version summary information.</p>
* <p>Conditional: You must specify either <code>TypeName</code> and <code>Type</code>, or <code>Arn</code>.</p>
* @public
*/
Arn?: string;

/**
* <p>The kind of extension.</p>
* <p>Conditional: You must specify either <code>TypeName</code> and <code>Type</code>, or <code>Arn</code>.</p>
* @public
*/
Type?: RegistryType;

/**
* <p>The name of the extension.</p>
* <p>Conditional: You must specify either <code>TypeName</code> and <code>Type</code>, or <code>Arn</code>.</p>
* @public
*/
TypeName?: string;

/**
* <p>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.</p>
* @public
*/
VersionId?: string;
}
34 changes: 34 additions & 0 deletions clients/client-cloudformation/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ManagedExecution,
Parameter,
PermissionModels,
RegistryType,
ResourceDefinition,
RollbackConfiguration,
StackSetOperationPreferences,
Expand All @@ -19,6 +20,39 @@ import {
ThirdPartyType,
} from "./models_0";

/**
* @public
*/
export interface SetTypeDefaultVersionInput {
/**
* <p>The Amazon Resource Name (ARN) of the extension for which you want version summary information.</p>
* <p>Conditional: You must specify either <code>TypeName</code> and <code>Type</code>, or <code>Arn</code>.</p>
* @public
*/
Arn?: string;

/**
* <p>The kind of extension.</p>
* <p>Conditional: You must specify either <code>TypeName</code> and <code>Type</code>, or <code>Arn</code>.</p>
* @public
*/
Type?: RegistryType;

/**
* <p>The name of the extension.</p>
* <p>Conditional: You must specify either <code>TypeName</code> and <code>Type</code>, or <code>Arn</code>.</p>
* @public
*/
TypeName?: string;

/**
* <p>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.</p>
* @public
*/
VersionId?: string;
}

/**
* @public
*/
Expand Down
6 changes: 5 additions & 1 deletion clients/client-cloudformation/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ import {
SetStackPolicyInput,
SetTypeConfigurationInput,
SetTypeConfigurationOutput,
SetTypeDefaultVersionInput,
Stack,
StackDriftInformation,
StackDriftInformationSummary,
Expand Down Expand Up @@ -474,6 +473,7 @@ import {
} from "../models/models_0";
import {
ResourceScanLimitExceededException,
SetTypeDefaultVersionInput,
SetTypeDefaultVersionOutput,
SignalResourceInput,
StartResourceScanInput,
Expand Down Expand Up @@ -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]);
}
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 98e1d9f

Please sign in to comment.