Skip to content

Commit 6f0caf6

Browse files
author
awstools
committed
feat(client-cloudformation): Added DeletionMode FORCE_DELETE_STACK for deleting a stack that is stuck in DELETE_FAILED state due to resource deletion failure.
1 parent 1489723 commit 6f0caf6

File tree

7 files changed

+146
-59
lines changed

7 files changed

+146
-59
lines changed

clients/client-cloudformation/src/commands/DeleteStackCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface DeleteStackCommandOutput extends __MetadataBearer {}
4242
* ],
4343
* RoleARN: "STRING_VALUE",
4444
* ClientRequestToken: "STRING_VALUE",
45+
* DeletionMode: "STANDARD" || "FORCE_DELETE_STACK",
4546
* };
4647
* const command = new DeleteStackCommand(input);
4748
* const response = await client.send(command);

clients/client-cloudformation/src/commands/DescribeStacksCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export interface DescribeStacksCommandOutput extends DescribeStacksOutput, __Met
105105
* // LastCheckTimestamp: new Date("TIMESTAMP"),
106106
* // },
107107
* // RetainExceptOnCreate: true || false,
108+
* // DeletionMode: "STANDARD" || "FORCE_DELETE_STACK",
108109
* // DetailedStatus: "CONFIGURATION_COMPLETE" || "VALIDATION_FAILED",
109110
* // },
110111
* // ],

clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { CloudFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFormationClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { SetTypeConfigurationInput } from "../models/models_0";
10-
import { SetTypeConfigurationOutput } from "../models/models_1";
9+
import { SetTypeConfigurationInput, SetTypeConfigurationOutput } from "../models/models_1";
1110
import { de_SetTypeConfigurationCommand, se_SetTypeConfigurationCommand } from "../protocols/Aws_query";
1211

1312
/**

clients/client-cloudformation/src/models/models_0.ts

+53-54
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@ export interface StackSetOperationPreferences {
27772777
* <code>STRICT_FAILURE_TOLERANCE</code>: This option dynamically lowers the concurrency level to ensure the
27782778
* number of failed accounts never exceeds the value of <code>FailureToleranceCount</code> +1. The initial actual
27792779
* concurrency is set to the lower of either the value of the <code>MaxConcurrentCount</code>, or the value of
2780-
* <code>MaxConcurrentCount</code> +1. The actual concurrency is then reduced proportionally by the number of
2780+
* <code>FailureToleranceCount</code> +1. The actual concurrency is then reduced proportionally by the number of
27812781
* failures. This is the default behavior.</p>
27822782
* <p>If failure tolerance or Maximum concurrent accounts are set to percentages, the behavior is similar.</p>
27832783
* </li>
@@ -3446,6 +3446,20 @@ export class GeneratedTemplateNotFoundException extends __BaseException {
34463446
}
34473447
}
34483448

3449+
/**
3450+
* @public
3451+
* @enum
3452+
*/
3453+
export const DeletionMode = {
3454+
FORCE_DELETE_STACK: "FORCE_DELETE_STACK",
3455+
STANDARD: "STANDARD",
3456+
} as const;
3457+
3458+
/**
3459+
* @public
3460+
*/
3461+
export type DeletionMode = (typeof DeletionMode)[keyof typeof DeletionMode];
3462+
34493463
/**
34503464
* <p>The input for <a>DeleteStack</a> action.</p>
34513465
* @public
@@ -3492,6 +3506,24 @@ export interface DeleteStackInput {
34923506
* @public
34933507
*/
34943508
ClientRequestToken?: string;
3509+
3510+
/**
3511+
* <p>Specifies the deletion mode for the stack. Possible values are:</p>
3512+
* <ul>
3513+
* <li>
3514+
* <p>
3515+
* <code>STANDARD</code> - Use the standard behavior. Specifying this value is the same as not specifying this
3516+
* parameter.</p>
3517+
* </li>
3518+
* <li>
3519+
* <p>
3520+
* <code>FORCE_DELETE_STACK</code> - Delete the stack if it's stuck in a <code>DELETE_FAILED</code> state due to
3521+
* resource deletion failure.</p>
3522+
* </li>
3523+
* </ul>
3524+
* @public
3525+
*/
3526+
DeletionMode?: DeletionMode;
34953527
}
34963528

34973529
/**
@@ -6188,6 +6220,24 @@ export interface Stack {
61886220
*/
61896221
RetainExceptOnCreate?: boolean;
61906222

6223+
/**
6224+
* <p>Specifies the deletion mode for the stack. Possible values are:</p>
6225+
* <ul>
6226+
* <li>
6227+
* <p>
6228+
* <code>STANDARD</code> - Use the standard behavior. Specifying this value is the same as not specifying this
6229+
* parameter.</p>
6230+
* </li>
6231+
* <li>
6232+
* <p>
6233+
* <code>FORCE_DELETE_STACK</code> - Delete the stack if it's stuck in a <code>DELETE_FAILED</code> state due to
6234+
* resource deletion failure.</p>
6235+
* </li>
6236+
* </ul>
6237+
* @public
6238+
*/
6239+
DeletionMode?: DeletionMode;
6240+
61916241
/**
61926242
* <p>The detailed status of the resource or stack. If <code>CONFIGURATION_COMPLETE</code> is present, the resource or
61936243
* resource configuration phase has completed and the stabilization of the resources is in progress. The stack sets
@@ -8809,8 +8859,8 @@ export interface StackInstanceResourceDriftsSummary {
88098859
*/
88108860
export interface ListStackInstanceResourceDriftsOutput {
88118861
/**
8812-
* <p>A list of <code>StackInstanceResourceDriftSummary</code> structures that contain information about the specified
8813-
* stack instances.</p>
8862+
* <p>A list of <code>StackInstanceResourceDriftsSummary</code> structures that contain information about the
8863+
* specified stack instances.</p>
88148864
* @public
88158865
*/
88168866
Summaries?: StackInstanceResourceDriftsSummary[];
@@ -10941,54 +10991,3 @@ export interface SetStackPolicyInput {
1094110991
*/
1094210992
StackPolicyURL?: string;
1094310993
}
10944-
10945-
/**
10946-
* @public
10947-
*/
10948-
export interface SetTypeConfigurationInput {
10949-
/**
10950-
* <p>The Amazon Resource Name (ARN) for the extension, in this account and Region.</p>
10951-
* <p>For public extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html">ActivateType</a> API operation in this account
10952-
* and Region. For private extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType</a> API operation in this account
10953-
* and Region.</p>
10954-
* <p>Do not include the extension versions suffix at the end of the ARN. You can set the configuration for an
10955-
* extension, but not for a specific extension version.</p>
10956-
* @public
10957-
*/
10958-
TypeArn?: string;
10959-
10960-
/**
10961-
* <p>The configuration data for the extension, in this account and Region.</p>
10962-
* <p>The configuration data must be formatted as JSON, and validate against the schema returned in the
10963-
* <code>ConfigurationSchema</code> response element of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>. For more information, see
10964-
* <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-model.html#resource-type-howto-configuration">Defining
10965-
* account-level configuration data for an extension</a> in the <i>CloudFormation CLI User
10966-
* Guide</i>.</p>
10967-
* @public
10968-
*/
10969-
Configuration: string | undefined;
10970-
10971-
/**
10972-
* <p>An alias by which to refer to this extension configuration data.</p>
10973-
* <p>Conditional: Specifying a configuration alias is required when setting a configuration for a resource type
10974-
* extension.</p>
10975-
* @public
10976-
*/
10977-
ConfigurationAlias?: string;
10978-
10979-
/**
10980-
* <p>The name of the extension.</p>
10981-
* <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and
10982-
* <code>TypeName</code>.</p>
10983-
* @public
10984-
*/
10985-
TypeName?: string;
10986-
10987-
/**
10988-
* <p>The type of extension.</p>
10989-
* <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and
10990-
* <code>TypeName</code>.</p>
10991-
* @public
10992-
*/
10993-
Type?: ThirdPartyType;
10994-
}

clients/client-cloudformation/src/models/models_1.ts

+51
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,57 @@ import {
2020
ThirdPartyType,
2121
} from "./models_0";
2222

23+
/**
24+
* @public
25+
*/
26+
export interface SetTypeConfigurationInput {
27+
/**
28+
* <p>The Amazon Resource Name (ARN) for the extension, in this account and Region.</p>
29+
* <p>For public extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html">ActivateType</a> API operation in this account
30+
* and Region. For private extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType</a> API operation in this account
31+
* and Region.</p>
32+
* <p>Do not include the extension versions suffix at the end of the ARN. You can set the configuration for an
33+
* extension, but not for a specific extension version.</p>
34+
* @public
35+
*/
36+
TypeArn?: string;
37+
38+
/**
39+
* <p>The configuration data for the extension, in this account and Region.</p>
40+
* <p>The configuration data must be formatted as JSON, and validate against the schema returned in the
41+
* <code>ConfigurationSchema</code> response element of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>. For more information, see
42+
* <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-model.html#resource-type-howto-configuration">Defining
43+
* account-level configuration data for an extension</a> in the <i>CloudFormation CLI User
44+
* Guide</i>.</p>
45+
* @public
46+
*/
47+
Configuration: string | undefined;
48+
49+
/**
50+
* <p>An alias by which to refer to this extension configuration data.</p>
51+
* <p>Conditional: Specifying a configuration alias is required when setting a configuration for a resource type
52+
* extension.</p>
53+
* @public
54+
*/
55+
ConfigurationAlias?: string;
56+
57+
/**
58+
* <p>The name of the extension.</p>
59+
* <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and
60+
* <code>TypeName</code>.</p>
61+
* @public
62+
*/
63+
TypeName?: string;
64+
65+
/**
66+
* <p>The type of extension.</p>
67+
* <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and
68+
* <code>TypeName</code>.</p>
69+
* @public
70+
*/
71+
Type?: ThirdPartyType;
72+
}
73+
2374
/**
2475
* @public
2576
*/

clients/client-cloudformation/src/protocols/Aws_query.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ import {
419419
ScannedResource,
420420
ScannedResourceIdentifier,
421421
SetStackPolicyInput,
422-
SetTypeConfigurationInput,
423422
Stack,
424423
StackDriftInformation,
425424
StackDriftInformationSummary,
@@ -472,6 +471,7 @@ import {
472471
} from "../models/models_0";
473472
import {
474473
ResourceScanLimitExceededException,
474+
SetTypeConfigurationInput,
475475
SetTypeConfigurationOutput,
476476
SetTypeDefaultVersionInput,
477477
SetTypeDefaultVersionOutput,
@@ -4676,6 +4676,9 @@ const se_DeleteStackInput = (input: DeleteStackInput, context: __SerdeContext):
46764676
if (input[_CRT] != null) {
46774677
entries[_CRT] = input[_CRT];
46784678
}
4679+
if (input[_DM] != null) {
4680+
entries[_DM] = input[_DM];
4681+
}
46794682
return entries;
46804683
};
46814684

@@ -9501,6 +9504,9 @@ const de_Stack = (output: any, context: __SerdeContext): Stack => {
95019504
if (output[_REOC] != null) {
95029505
contents[_REOC] = __parseBoolean(output[_REOC]);
95039506
}
9507+
if (output[_DM] != null) {
9508+
contents[_DM] = __expectString(output[_DM]);
9509+
}
95049510
if (output[_DSeta] != null) {
95059511
contents[_DSeta] = __expectString(output[_DSeta]);
95069512
}
@@ -11135,6 +11141,7 @@ const _DDS = "DriftDetectionStatus";
1113511141
const _DGT = "DeleteGeneratedTemplate";
1113611142
const _DGTe = "DescribeGeneratedTemplate";
1113711143
const _DI = "DriftInformation";
11144+
const _DM = "DeletionMode";
1113811145
const _DOA = "DeactivateOrganizationsAccess";
1113911146
const _DOAe = "DescribeOrganizationsAccess";
1114011147
const _DP = "DescribePublisher";

codegen/sdk-codegen/aws-models/cloudformation.json

+31-2
Original file line numberDiff line numberDiff line change
@@ -3417,6 +3417,12 @@
34173417
"traits": {
34183418
"smithy.api#documentation": "<p>A unique identifier for this <code>DeleteStack</code> request. Specify this token if you plan to retry requests\n so that CloudFormation knows that you're not attempting to delete a stack with the same name. You might retry\n <code>DeleteStack</code> requests to ensure that CloudFormation successfully received them.</p>\n <p>All events initiated by a given stack operation are assigned the same client request token, which you can use to\n track operations. For example, if you execute a <code>CreateStack</code> operation with the token\n <code>token1</code>, then all the <code>StackEvents</code> generated by that operation will have\n <code>ClientRequestToken</code> set as <code>token1</code>.</p>\n <p>In the console, stack operations display the client request token on the Events tab. Stack operations that are\n initiated from the console use the token format <i>Console-StackOperation-ID</i>, which helps you\n easily identify the stack operation . For example, if you create a stack using the console, each stack event would be\n assigned the same token in the following format:\n <code>Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002</code>.</p>"
34193419
}
3420+
},
3421+
"DeletionMode": {
3422+
"target": "com.amazonaws.cloudformation#DeletionMode",
3423+
"traits": {
3424+
"smithy.api#documentation": "<p>Specifies the deletion mode for the stack. Possible values are:</p>\n <ul>\n <li>\n <p>\n <code>STANDARD</code> - Use the standard behavior. Specifying this value is the same as not specifying this\n parameter.</p>\n </li>\n <li>\n <p>\n <code>FORCE_DELETE_STACK</code> - Delete the stack if it's stuck in a <code>DELETE_FAILED</code> state due to\n resource deletion failure.</p>\n </li>\n </ul>"
3425+
}
34203426
}
34213427
},
34223428
"traits": {
@@ -3579,6 +3585,23 @@
35793585
"smithy.api#output": {}
35803586
}
35813587
},
3588+
"com.amazonaws.cloudformation#DeletionMode": {
3589+
"type": "enum",
3590+
"members": {
3591+
"STANDARD": {
3592+
"target": "smithy.api#Unit",
3593+
"traits": {
3594+
"smithy.api#enumValue": "STANDARD"
3595+
}
3596+
},
3597+
"FORCE_DELETE_STACK": {
3598+
"target": "smithy.api#Unit",
3599+
"traits": {
3600+
"smithy.api#enumValue": "FORCE_DELETE_STACK"
3601+
}
3602+
}
3603+
}
3604+
},
35823605
"com.amazonaws.cloudformation#DeletionTime": {
35833606
"type": "timestamp"
35843607
},
@@ -7930,7 +7953,7 @@
79307953
"Summaries": {
79317954
"target": "com.amazonaws.cloudformation#StackInstanceResourceDriftsSummaries",
79327955
"traits": {
7933-
"smithy.api#documentation": "<p>A list of <code>StackInstanceResourceDriftSummary</code> structures that contain information about the specified\n stack instances.</p>"
7956+
"smithy.api#documentation": "<p>A list of <code>StackInstanceResourceDriftsSummary</code> structures that contain information about the\n specified stack instances.</p>"
79347957
}
79357958
},
79367959
"NextToken": {
@@ -11501,6 +11524,12 @@
1150111524
"smithy.api#documentation": "<p>When set to <code>true</code>, newly created resources are deleted when the operation rolls back. This includes\n newly created resources marked with a deletion policy of <code>Retain</code>.</p>\n <p>Default: <code>false</code>\n </p>"
1150211525
}
1150311526
},
11527+
"DeletionMode": {
11528+
"target": "com.amazonaws.cloudformation#DeletionMode",
11529+
"traits": {
11530+
"smithy.api#documentation": "<p>Specifies the deletion mode for the stack. Possible values are:</p>\n <ul>\n <li>\n <p>\n <code>STANDARD</code> - Use the standard behavior. Specifying this value is the same as not specifying this\n parameter.</p>\n </li>\n <li>\n <p>\n <code>FORCE_DELETE_STACK</code> - Delete the stack if it's stuck in a <code>DELETE_FAILED</code> state due to\n resource deletion failure.</p>\n </li>\n </ul>"
11531+
}
11532+
},
1150411533
"DetailedStatus": {
1150511534
"target": "com.amazonaws.cloudformation#DetailedStatus",
1150611535
"traits": {
@@ -13115,7 +13144,7 @@
1311513144
"ConcurrencyMode": {
1311613145
"target": "com.amazonaws.cloudformation#ConcurrencyMode",
1311713146
"traits": {
13118-
"smithy.api#documentation": "<p>Specifies how the concurrency level behaves during the operation execution.</p>\n <ul>\n <li>\n <p>\n <code>STRICT_FAILURE_TOLERANCE</code>: This option dynamically lowers the concurrency level to ensure the\n number of failed accounts never exceeds the value of <code>FailureToleranceCount</code> +1. The initial actual\n concurrency is set to the lower of either the value of the <code>MaxConcurrentCount</code>, or the value of\n <code>MaxConcurrentCount</code> +1. The actual concurrency is then reduced proportionally by the number of\n failures. This is the default behavior.</p>\n <p>If failure tolerance or Maximum concurrent accounts are set to percentages, the behavior is similar.</p>\n </li>\n <li>\n <p>\n <code>SOFT_FAILURE_TOLERANCE</code>: This option decouples <code>FailureToleranceCount</code> from the actual\n concurrency. This allows stack set operations to run at the concurrency level set by the\n <code>MaxConcurrentCount</code> value, or <code>MaxConcurrentPercentage</code>, regardless of the number of\n failures.</p>\n </li>\n </ul>"
13147+
"smithy.api#documentation": "<p>Specifies how the concurrency level behaves during the operation execution.</p>\n <ul>\n <li>\n <p>\n <code>STRICT_FAILURE_TOLERANCE</code>: This option dynamically lowers the concurrency level to ensure the\n number of failed accounts never exceeds the value of <code>FailureToleranceCount</code> +1. The initial actual\n concurrency is set to the lower of either the value of the <code>MaxConcurrentCount</code>, or the value of\n <code>FailureToleranceCount</code> +1. The actual concurrency is then reduced proportionally by the number of\n failures. This is the default behavior.</p>\n <p>If failure tolerance or Maximum concurrent accounts are set to percentages, the behavior is similar.</p>\n </li>\n <li>\n <p>\n <code>SOFT_FAILURE_TOLERANCE</code>: This option decouples <code>FailureToleranceCount</code> from the actual\n concurrency. This allows stack set operations to run at the concurrency level set by the\n <code>MaxConcurrentCount</code> value, or <code>MaxConcurrentPercentage</code>, regardless of the number of\n failures.</p>\n </li>\n </ul>"
1311913148
}
1312013149
}
1312113150
},

0 commit comments

Comments
 (0)