Skip to content

Commit

Permalink
feat(client-cloudformation): This SDK release is for the feature laun…
Browse files Browse the repository at this point in the history
…ch of AWS CloudFormation RetainExceptOnCreate. It adds a new parameter retainExceptOnCreate in the following APIs: CreateStack, UpdateStack, RollbackStack, ExecuteChangeSet.
  • Loading branch information
awstools committed Jul 28, 2023
1 parent f0fedc3 commit b65b959
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface CreateStackCommandOutput extends CreateStackOutput, __MetadataB
* ],
* ClientRequestToken: "STRING_VALUE",
* EnableTerminationProtection: true || false,
* RetainExceptOnCreate: true || false,
* };
* const command = new CreateStackCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export interface DescribeStacksCommandOutput extends DescribeStacksOutput, __Met
* // StackDriftStatus: "DRIFTED" || "IN_SYNC" || "UNKNOWN" || "NOT_CHECKED", // required
* // LastCheckTimestamp: new Date("TIMESTAMP"),
* // },
* // RetainExceptOnCreate: true || false,
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface ExecuteChangeSetCommandOutput extends ExecuteChangeSetOutput, _
* StackName: "STRING_VALUE",
* ClientRequestToken: "STRING_VALUE",
* DisableRollback: true || false,
* RetainExceptOnCreate: true || false,
* };
* const command = new ExecuteChangeSetCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface RollbackStackCommandOutput extends RollbackStackOutput, __Metad
* StackName: "STRING_VALUE", // required
* RoleARN: "STRING_VALUE",
* ClientRequestToken: "STRING_VALUE",
* RetainExceptOnCreate: true || false,
* };
* const command = new RollbackStackCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export interface UpdateStackCommandOutput extends UpdateStackOutput, __MetadataB
* ],
* DisableRollback: true || false,
* ClientRequestToken: "STRING_VALUE",
* RetainExceptOnCreate: true || false,
* };
* const command = new UpdateStackCommand(input);
* const response = await client.send(command);
Expand Down
2 changes: 1 addition & 1 deletion clients/client-cloudformation/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ o={[t]:"booleanEquals",[u]:[true,{[t]:f,[u]:[n,"supportsDualStack"]}]},
p=[j],
q=[k],
r=[{[v]:"Region"}];
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]}]},{type:b,rules:[{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://cloudformation-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://cloudformation.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://cloudformation-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://cloudformation.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://cloudformation.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]},{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{endpoint:{url:"https://cloudformation-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://cloudformation.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://cloudformation-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{endpoint:{url:"https://cloudformation.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://cloudformation.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]};
export const ruleSet: RuleSetObject = _data;
54 changes: 54 additions & 0 deletions clients/client-cloudformation/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ export interface ActivateTypeOutput {
export class CFNRegistryException extends __BaseException {
readonly name: "CFNRegistryException" = "CFNRegistryException";
readonly $fault: "client" = "client";
/**
* <p>An message with details about the error that occurred.</p>
*/
Message?: string;
/**
* @internal
Expand All @@ -353,6 +356,9 @@ export class CFNRegistryException extends __BaseException {
export class TypeNotFoundException extends __BaseException {
readonly name: "TypeNotFoundException" = "TypeNotFoundException";
readonly $fault: "client" = "client";
/**
* <p>An message with details about the error that occurred.</p>
*/
Message?: string;
/**
* @internal
Expand Down Expand Up @@ -556,6 +562,9 @@ export interface BatchDescribeTypeConfigurationsOutput {
export class TypeConfigurationNotFoundException extends __BaseException {
readonly name: "TypeConfigurationNotFoundException" = "TypeConfigurationNotFoundException";
readonly $fault: "client" = "client";
/**
* <p>An message with details about the error that occurred.</p>
*/
Message?: string;
/**
* @internal
Expand Down Expand Up @@ -2134,6 +2143,15 @@ export interface CreateStackInput {
* stack.</p>
*/
EnableTerminationProtection?: boolean;

/**
* <p>This deletion policy deletes newly created resources, but retains existing resources, when a stack operation is
* rolled back. This ensures new, empty, and unused resources are deleted, while critical resources and their data are
* retained. <code>RetainExceptOnCreate</code> can be specified for any resource that supports the
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html">
* DeletionPolicy</a> attribute.</p>
*/
RetainExceptOnCreate?: boolean;
}

/**
Expand Down Expand Up @@ -4879,6 +4897,15 @@ export interface Stack {
* information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting Unregulated Configuration Changes to Stacks and Resources</a>.</p>
*/
DriftInformation?: StackDriftInformation;

/**
* <p>This deletion policy deletes newly created resources, but retains existing resources, when a stack operation is
* rolled back. This ensures new, empty, and unused resources are deleted, while critical resources and their data are
* retained. <code>RetainExceptOnCreate</code> can be specified for any resource that supports the
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html">
* DeletionPolicy</a> attribute.</p>
*/
RetainExceptOnCreate?: boolean;
}

/**
Expand Down Expand Up @@ -6090,6 +6117,15 @@ export interface ExecuteChangeSetInput {
* </p>
*/
DisableRollback?: boolean;

/**
* <p>This deletion policy deletes newly created resources, but retains existing resources, when a stack operation is
* rolled back. This ensures new, empty, and unused resources are deleted, while critical resources and their data are
* retained. <code>RetainExceptOnCreate</code> can be specified for any resource that supports the
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html">
* DeletionPolicy</a> attribute.</p>
*/
RetainExceptOnCreate?: boolean;
}

/**
Expand Down Expand Up @@ -8631,6 +8667,15 @@ export interface RollbackStackInput {
* <p>A unique identifier for this <code>RollbackStack</code> request.</p>
*/
ClientRequestToken?: string;

/**
* <p>This deletion policy deletes newly created resources, but retains existing resources, when a stack operation is
* rolled back. This ensures new, empty, and unused resources are deleted, while critical resources and their data are
* retained. <code>RetainExceptOnCreate</code> can be specified for any resource that supports the
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html">
* DeletionPolicy</a> attribute.</p>
*/
RetainExceptOnCreate?: boolean;
}

/**
Expand Down Expand Up @@ -9148,6 +9193,15 @@ export interface UpdateStackInput {
* <code>Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002</code>.</p>
*/
ClientRequestToken?: string;

/**
* <p>This deletion policy deletes newly created resources, but retains existing resources, when a stack operation is
* rolled back. This ensures new, empty, and unused resources are deleted, while critical resources and their data are
* retained. <code>RetainExceptOnCreate</code> can be specified for any resource that supports the
* <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html">
* DeletionPolicy</a> attribute.</p>
*/
RetainExceptOnCreate?: boolean;
}

/**
Expand Down
15 changes: 15 additions & 0 deletions clients/client-cloudformation/src/protocols/Aws_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5576,6 +5576,9 @@ const se_CreateStackInput = (input: CreateStackInput, context: __SerdeContext):
if (input.EnableTerminationProtection != null) {
entries["EnableTerminationProtection"] = input.EnableTerminationProtection;
}
if (input.RetainExceptOnCreate != null) {
entries["RetainExceptOnCreate"] = input.RetainExceptOnCreate;
}
return entries;
};

Expand Down Expand Up @@ -6283,6 +6286,9 @@ const se_ExecuteChangeSetInput = (input: ExecuteChangeSetInput, context: __Serde
if (input.DisableRollback != null) {
entries["DisableRollback"] = input.DisableRollback;
}
if (input.RetainExceptOnCreate != null) {
entries["RetainExceptOnCreate"] = input.RetainExceptOnCreate;
}
return entries;
};

Expand Down Expand Up @@ -7103,6 +7109,9 @@ const se_RollbackStackInput = (input: RollbackStackInput, context: __SerdeContex
if (input.ClientRequestToken != null) {
entries["ClientRequestToken"] = input.ClientRequestToken;
}
if (input.RetainExceptOnCreate != null) {
entries["RetainExceptOnCreate"] = input.RetainExceptOnCreate;
}
return entries;
};

Expand Down Expand Up @@ -7574,6 +7583,9 @@ const se_UpdateStackInput = (input: UpdateStackInput, context: __SerdeContext):
if (input.ClientRequestToken != null) {
entries["ClientRequestToken"] = input.ClientRequestToken;
}
if (input.RetainExceptOnCreate != null) {
entries["RetainExceptOnCreate"] = input.RetainExceptOnCreate;
}
return entries;
};

Expand Down Expand Up @@ -9928,6 +9940,9 @@ const de_Stack = (output: any, context: __SerdeContext): Stack => {
if (output["DriftInformation"] !== undefined) {
contents.DriftInformation = de_StackDriftInformation(output["DriftInformation"], context);
}
if (output["RetainExceptOnCreate"] !== undefined) {
contents.RetainExceptOnCreate = __parseBoolean(output["RetainExceptOnCreate"]);
}
return contents;
};

Expand Down

0 comments on commit b65b959

Please sign in to comment.