Skip to content

Commit

Permalink
feat(client-cloudformation): Adding support for the new parameter "In…
Browse files Browse the repository at this point in the history
…cludePropertyValues" in the CloudFormation DescribeChangeSet API. When this parameter is included, the DescribeChangeSet response will include more detailed information such as before and after values for the resource properties that will change.
  • Loading branch information
awstools committed Apr 12, 2024
1 parent 874e200 commit aed244d
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetOutput,
* ChangeSetName: "STRING_VALUE", // required
* StackName: "STRING_VALUE",
* NextToken: "STRING_VALUE",
* IncludePropertyValues: true || false,
* };
* const command = new DescribeChangeSetCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -102,6 +103,10 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetOutput,
* // Attribute: "Properties" || "Metadata" || "CreationPolicy" || "UpdatePolicy" || "DeletionPolicy" || "UpdateReplacePolicy" || "Tags",
* // Name: "STRING_VALUE",
* // RequiresRecreation: "Never" || "Conditionally" || "Always",
* // Path: "STRING_VALUE",
* // BeforeValue: "STRING_VALUE",
* // AfterValue: "STRING_VALUE",
* // AttributeChangeType: "Add" || "Remove" || "Modify",
* // },
* // Evaluation: "Static" || "Dynamic",
* // ChangeSource: "ResourceReference" || "ParameterReference" || "ResourceAttribute" || "DirectModification" || "Automatic",
Expand All @@ -113,6 +118,8 @@ export interface DescribeChangeSetCommandOutput extends DescribeChangeSetOutput,
* // TypeHierarchy: "STRING_VALUE",
* // LogicalIdHierarchy: "STRING_VALUE",
* // },
* // BeforeContext: "STRING_VALUE",
* // AfterContext: "STRING_VALUE",
* // },
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { SetTypeConfigurationInput, SetTypeConfigurationOutput } from "../models/models_0";
import { SetTypeConfigurationInput } from "../models/models_0";
import { SetTypeConfigurationOutput } from "../models/models_1";
import { de_SetTypeConfigurationCommand, se_SetTypeConfigurationCommand } from "../protocols/Aws_query";

/**
Expand Down
92 changes: 78 additions & 14 deletions clients/client-cloudformation/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,21 @@ export class AlreadyExistsException extends __BaseException {
}
}

/**
* @public
* @enum
*/
export const AttributeChangeType = {
Add: "Add",
Modify: "Modify",
Remove: "Remove",
} as const;

/**
* @public
*/
export type AttributeChangeType = (typeof AttributeChangeType)[keyof typeof AttributeChangeType];

/**
* <p>[Service-managed permissions] Describes whether StackSets automatically deploys to Organizations
* accounts that are added to a target organization or organizational unit (OU).</p>
Expand Down Expand Up @@ -820,6 +835,44 @@ export interface ResourceTargetDefinition {
* @public
*/
RequiresRecreation?: RequiresRecreation;

/**
* <p>The property path of the property.</p>
* @public
*/
Path?: string;

/**
* <p>The value of the property before the change is executed. Large values can be truncated.</p>
* @public
*/
BeforeValue?: string;

/**
* <p>The value of the property after the change is executed. Large values can be truncated.</p>
* @public
*/
AfterValue?: string;

/**
* <p>The type of change to be made to the property if the change is executed.</p>
* <ul>
* <li>
* <p>
* <code>Add</code> The item will be added.</p>
* </li>
* <li>
* <p>
* <code>Remove</code> The item will be removed.</p>
* </li>
* <li>
* <p>
* <code>Modify</code> The item will be modified.</p>
* </li>
* </ul>
* @public
*/
AttributeChangeType?: AttributeChangeType;
}

/**
Expand Down Expand Up @@ -1070,6 +1123,18 @@ export interface ResourceChange {
* @public
*/
ModuleInfo?: ModuleInfo;

/**
* <p>An encoded JSON string containing the context of the resource before the change is executed.</p>
* @public
*/
BeforeContext?: string;

/**
* <p>An encoded JSON string containing the context of the resource after the change is executed.</p>
* @public
*/
AfterContext?: string;
}

/**
Expand All @@ -1091,7 +1156,13 @@ export type ChangeType = (typeof ChangeType)[keyof typeof ChangeType];
*/
export interface Change {
/**
* <p>The type of entity that CloudFormation changes. Currently, the only entity type is <code>Resource</code>.</p>
* <p>The type of entity that CloudFormation changes.</p>
* <ul>
* <li>
* <p>
* <code>Resource</code> This change is for a resource.</p>
* </li>
* </ul>
* @public
*/
Type?: ChangeType;
Expand Down Expand Up @@ -3678,6 +3749,12 @@ export interface DescribeChangeSetInput {
* @public
*/
NextToken?: string;

/**
* <p>If <code>true</code>, the returned changes include detailed changes in the property values.</p>
* @public
*/
IncludePropertyValues?: boolean;
}

/**
Expand Down Expand Up @@ -10915,16 +10992,3 @@ export interface SetTypeConfigurationInput {
*/
Type?: ThirdPartyType;
}

/**
* @public
*/
export interface SetTypeConfigurationOutput {
/**
* <p>The Amazon Resource Name (ARN) for the configuration data, in this account and Region.</p>
* <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and
* <code>TypeName</code>.</p>
* @public
*/
ConfigurationArn?: string;
}
13 changes: 13 additions & 0 deletions clients/client-cloudformation/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ import {
ThirdPartyType,
} from "./models_0";

/**
* @public
*/
export interface SetTypeConfigurationOutput {
/**
* <p>The Amazon Resource Name (ARN) for the configuration data, in this account and Region.</p>
* <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and
* <code>TypeName</code>.</p>
* @public
*/
ConfigurationArn?: string;
}

/**
* @public
*/
Expand Down
30 changes: 29 additions & 1 deletion clients/client-cloudformation/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ import {
ScannedResourceIdentifier,
SetStackPolicyInput,
SetTypeConfigurationInput,
SetTypeConfigurationOutput,
Stack,
StackDriftInformation,
StackDriftInformationSummary,
Expand Down Expand Up @@ -473,6 +472,7 @@ import {
} from "../models/models_0";
import {
ResourceScanLimitExceededException,
SetTypeConfigurationOutput,
SetTypeDefaultVersionInput,
SetTypeDefaultVersionOutput,
SignalResourceInput,
Expand Down Expand Up @@ -4849,6 +4849,9 @@ const se_DescribeChangeSetInput = (input: DescribeChangeSetInput, context: __Ser
if (input[_NT] != null) {
entries[_NT] = input[_NT];
}
if (input[_IPV] != null) {
entries[_IPV] = input[_IPV];
}
return entries;
};

Expand Down Expand Up @@ -9052,6 +9055,12 @@ const de_ResourceChange = (output: any, context: __SerdeContext): ResourceChange
if (output[_MI] != null) {
contents[_MI] = de_ModuleInfo(output[_MI], context);
}
if (output[_BC] != null) {
contents[_BC] = __expectString(output[_BC]);
}
if (output[_AC] != null) {
contents[_AC] = __expectString(output[_AC]);
}
return contents;
};

Expand Down Expand Up @@ -9270,6 +9279,18 @@ const de_ResourceTargetDefinition = (output: any, context: __SerdeContext): Reso
if (output[_RReq] != null) {
contents[_RReq] = __expectString(output[_RReq]);
}
if (output[_Pa] != null) {
contents[_Pa] = __expectString(output[_Pa]);
}
if (output[_BV] != null) {
contents[_BV] = __expectString(output[_BV]);
}
if (output[_AVf] != null) {
contents[_AVf] = __expectString(output[_AVf]);
}
if (output[_ACT] != null) {
contents[_ACT] = __expectString(output[_ACT]);
}
return contents;
};

Expand Down Expand Up @@ -11050,6 +11071,8 @@ const SHARED_HEADERS: __HeaderBag = {

const _ = "2010-05-15";
const _A = "Action";
const _AC = "AfterContext";
const _ACT = "AttributeChangeType";
const _AD = "AutoDeployment";
const _AFT = "AccountFilterType";
const _AGR = "AccountGateResult";
Expand All @@ -11064,14 +11087,17 @@ const _AU = "AutoUpdate";
const _AUc = "AccountsUrl";
const _AV = "AllowedValues";
const _AVc = "ActualValue";
const _AVf = "AfterValue";
const _Ac = "Accounts";
const _Acc = "Account";
const _Act = "Active";
const _Al = "Alias";
const _Ar = "Arn";
const _At = "Attribute";
const _BC = "BeforeContext";
const _BDTC = "BatchDescribeTypeConfigurations";
const _BT = "BearerToken";
const _BV = "BeforeValue";
const _C = "Capabilities";
const _CA = "CallAs";
const _CAo = "ConnectionArn";
Expand Down Expand Up @@ -11195,6 +11221,7 @@ const _IER = "ImportExistingResources";
const _INS = "IncludeNestedStacks";
const _IP = "InvocationPoint";
const _IPSIC = "InProgressStackInstancesCount";
const _IPV = "IncludePropertyValues";
const _IPd = "IdentityProvider";
const _ISSIC = "InSyncStackInstancesCount";
const _ISTSS = "ImportStacksToStackSet";
Expand Down Expand Up @@ -11285,6 +11312,7 @@ const _PTa = "ParameterType";
const _PTr = "ProvisioningType";
const _PV = "ParameterValue";
const _PVN = "PublicVersionNumber";
const _Pa = "Path";
const _Pr = "Progress";
const _Pro = "Properties";
const _R = "Resources";
Expand Down

0 comments on commit aed244d

Please sign in to comment.