takomo 9.0.0-alpha.2 → 9.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-io/formatters.js +2 -2
- package/dist/cli-io/formatters.js.map +1 -1
- package/dist/command/stacks/common/load-current-cf-stacks.d.ts +2 -1
- package/dist/command/stacks/common/load-current-cf-stacks.js +15 -12
- package/dist/command/stacks/common/load-current-cf-stacks.js.map +1 -1
- package/dist/command/stacks/deploy/custom-stack/states.d.ts +1 -1
- package/dist/command/stacks/deploy/custom-stack/steps/get-changes.js +2 -2
- package/dist/command/stacks/deploy/custom-stack/steps/get-changes.js.map +1 -1
- package/dist/command/stacks/deploy/custom-stack/steps/review-deployment.js +2 -2
- package/dist/command/stacks/deploy/custom-stack/steps/review-deployment.js.map +1 -1
- package/dist/command/stacks/deploy/custom-stack/steps/update-stack.js +2 -2
- package/dist/command/stacks/deploy/custom-stack/steps/update-stack.js.map +1 -1
- package/dist/command/stacks/deploy/custom-stack/steps/wait-dependencies-to-complete.js +2 -5
- package/dist/command/stacks/deploy/custom-stack/steps/wait-dependencies-to-complete.js.map +1 -1
- package/dist/command/stacks/deploy/deploy-stack.js +2 -6
- package/dist/command/stacks/deploy/deploy-stack.js.map +1 -1
- package/dist/command/stacks/deploy/plan.js +2 -1
- package/dist/command/stacks/deploy/plan.js.map +1 -1
- package/dist/command/stacks/undeploy/custom-stack/steps/delete-stack.js +1 -1
- package/dist/command/stacks/undeploy/custom-stack/steps/delete-stack.js.map +1 -1
- package/dist/command/stacks/undeploy/plan.js +4 -2
- package/dist/command/stacks/undeploy/plan.js.map +1 -1
- package/dist/command/stacks/undeploy/validate.js +7 -1
- package/dist/command/stacks/undeploy/validate.js.map +1 -1
- package/dist/custom-stacks/cmd-custom-stack-handler.js +5 -5
- package/dist/custom-stacks/cmd-custom-stack-handler.js.map +1 -1
- package/dist/custom-stacks/custom-stack-handler.d.ts +174 -36
- package/dist/stacks/custom-stack.d.ts +1 -1
- package/dist/stacks/custom-stack.js +2 -1
- package/dist/stacks/custom-stack.js.map +1 -1
- package/dist/stacks/stack.d.ts +6 -0
- package/dist/stacks/stack.js.map +1 -1
- package/dist/stacks/standard-stack.js +2 -1
- package/dist/stacks/standard-stack.js.map +1 -1
- package/dist/takomo-stacks-context/config/build-custom-stack.js +5 -3
- package/dist/takomo-stacks-context/config/build-custom-stack.js.map +1 -1
- package/dist/takomo-stacks-context/config/build-standard-stack.js +2 -0
- package/dist/takomo-stacks-context/config/build-standard-stack.js.map +1 -1
- package/package.json +27 -27
|
@@ -12,7 +12,7 @@ export type OutputName = string;
|
|
|
12
12
|
export type OutputValue = string;
|
|
13
13
|
export type Outputs = Record<OutputName, OutputValue>;
|
|
14
14
|
/**
|
|
15
|
-
* Represents the state of a custom stack. All
|
|
15
|
+
* Represents the state of a custom stack. All but the `status` property are optional to allow
|
|
16
16
|
* flexibility for different custom stack implementations.
|
|
17
17
|
*/
|
|
18
18
|
export type CustomStackState = {
|
|
@@ -56,6 +56,8 @@ export type GetCurrentStateProps<CONFIG> = {
|
|
|
56
56
|
readonly config: CONFIG;
|
|
57
57
|
/**
|
|
58
58
|
* The custom stack for which the current state is being retrieved.
|
|
59
|
+
*
|
|
60
|
+
* Stack provides access for stack path, name, region, and AWS credentials.
|
|
59
61
|
*/
|
|
60
62
|
readonly stack: CustomStack;
|
|
61
63
|
/**
|
|
@@ -66,12 +68,14 @@ export type GetCurrentStateProps<CONFIG> = {
|
|
|
66
68
|
/**
|
|
67
69
|
* Represents a successful result of getting the current state of a custom stack.
|
|
68
70
|
*/
|
|
69
|
-
export type SuccessfulGetCurrentStateResult<
|
|
71
|
+
export type SuccessfulGetCurrentStateResult<STATE extends CustomStackState> = {
|
|
70
72
|
readonly success: true;
|
|
71
73
|
/**
|
|
72
|
-
* The current state of the custom stack.
|
|
74
|
+
* The current state of the custom stack. This property is optional to allow
|
|
75
|
+
* flexibility for different custom stack implementations. An undefined value
|
|
76
|
+
* indicates that the stack does not exist.
|
|
73
77
|
*/
|
|
74
|
-
readonly
|
|
78
|
+
readonly currentState?: STATE;
|
|
75
79
|
};
|
|
76
80
|
/**
|
|
77
81
|
* Represents a failed result of getting the current state of a custom stack.
|
|
@@ -113,6 +117,8 @@ export type CreateCustomStackProps<CONFIG> = {
|
|
|
113
117
|
readonly tags: Tags;
|
|
114
118
|
/**
|
|
115
119
|
* The custom stack to be created.
|
|
120
|
+
*
|
|
121
|
+
* Stack provides access for stack path, name, region, and AWS credentials.
|
|
116
122
|
*/
|
|
117
123
|
readonly stack: CustomStack;
|
|
118
124
|
/**
|
|
@@ -128,7 +134,7 @@ export type SuccessfulCreateCustomStackResult<STATE extends CustomStackState> =
|
|
|
128
134
|
/**
|
|
129
135
|
* The state of the custom stack after creation.
|
|
130
136
|
*/
|
|
131
|
-
readonly
|
|
137
|
+
readonly createdState: STATE;
|
|
132
138
|
};
|
|
133
139
|
/**
|
|
134
140
|
* Represents a failed result of creating a custom stack.
|
|
@@ -159,7 +165,7 @@ export type UpdateCustomStackProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
159
165
|
/**
|
|
160
166
|
* The current state of the custom stack.
|
|
161
167
|
*/
|
|
162
|
-
readonly
|
|
168
|
+
readonly currentState: STATE;
|
|
163
169
|
/**
|
|
164
170
|
* The configuration object for the custom stack.
|
|
165
171
|
*/
|
|
@@ -174,6 +180,8 @@ export type UpdateCustomStackProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
174
180
|
readonly tags: Tags;
|
|
175
181
|
/**
|
|
176
182
|
* The custom stack to be updated.
|
|
183
|
+
*
|
|
184
|
+
* Stack provides access for stack path, name, region, and AWS credentials.
|
|
177
185
|
*/
|
|
178
186
|
readonly stack: CustomStack;
|
|
179
187
|
/**
|
|
@@ -181,21 +189,33 @@ export type UpdateCustomStackProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
181
189
|
*/
|
|
182
190
|
readonly ctx: StacksContext;
|
|
183
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* Represents a successful result of updating a custom stack.
|
|
194
|
+
*
|
|
195
|
+
* Contains the updated state of the custom stack after the operation completes successfully.
|
|
196
|
+
*/
|
|
184
197
|
export type SuccessfulUpdateCustomStackResult<STATE extends CustomStackState> = {
|
|
185
198
|
readonly success: true;
|
|
186
199
|
/**
|
|
187
|
-
* The updated state of the custom stack.
|
|
200
|
+
* The updated state of the custom stack after the update operation.
|
|
201
|
+
* This reflects the new state of the stack with all changes applied.
|
|
188
202
|
*/
|
|
189
|
-
readonly
|
|
203
|
+
readonly updatedState: STATE;
|
|
190
204
|
};
|
|
205
|
+
/**
|
|
206
|
+
* Represents a failed result of updating a custom stack.
|
|
207
|
+
*
|
|
208
|
+
* Provides information about why the update operation failed, including
|
|
209
|
+
* optional error details and descriptive messages for troubleshooting.
|
|
210
|
+
*/
|
|
191
211
|
export type FailedUpdateCustomStackResult = {
|
|
192
212
|
readonly success: false;
|
|
193
213
|
/**
|
|
194
|
-
* An optional error object
|
|
214
|
+
* An optional error object containing detailed information about the failure.
|
|
195
215
|
*/
|
|
196
216
|
readonly error?: Error;
|
|
197
217
|
/**
|
|
198
|
-
* An optional message providing additional
|
|
218
|
+
* An optional human-readable message providing additional context about the failure.
|
|
199
219
|
*/
|
|
200
220
|
readonly message?: string;
|
|
201
221
|
};
|
|
@@ -214,7 +234,7 @@ export type ParseConfigProps = {
|
|
|
214
234
|
/**
|
|
215
235
|
* The raw configuration object to be parsed.
|
|
216
236
|
*/
|
|
217
|
-
readonly
|
|
237
|
+
readonly rawConfig: unknown;
|
|
218
238
|
/**
|
|
219
239
|
* The stack path of the custom stack.
|
|
220
240
|
*/
|
|
@@ -222,22 +242,34 @@ export type ParseConfigProps = {
|
|
|
222
242
|
};
|
|
223
243
|
/**
|
|
224
244
|
* Represents a successful result of parsing a custom stack configuration.
|
|
245
|
+
*
|
|
246
|
+
* Contains the validated and parsed configuration object that can be safely
|
|
247
|
+
* used in subsequent custom stack operations such as create, update and delete.
|
|
225
248
|
*/
|
|
226
249
|
export type SuccessfulParseConfigResult<CONFIG> = {
|
|
227
250
|
readonly success: true;
|
|
228
|
-
|
|
251
|
+
/**
|
|
252
|
+
* The successfully parsed and validated configuration object.
|
|
253
|
+
* This configuration will be used for all subsequent stack operations.
|
|
254
|
+
*/
|
|
255
|
+
readonly parsedConfig: CONFIG;
|
|
229
256
|
};
|
|
230
257
|
/**
|
|
231
258
|
* Represents a failed result of parsing a custom stack configuration.
|
|
259
|
+
*
|
|
260
|
+
* Provides detailed information about validation or parsing failures,
|
|
261
|
+
* helping users understand what went wrong with their configuration.
|
|
232
262
|
*/
|
|
233
263
|
export type FailedParseConfigResult = {
|
|
234
264
|
readonly success: false;
|
|
235
265
|
/**
|
|
236
|
-
* An optional error object
|
|
266
|
+
* An optional error object containing detailed information about the parsing failure.
|
|
267
|
+
* This may include validation errors, schema mismatches, or other configuration issues.
|
|
237
268
|
*/
|
|
238
269
|
readonly error?: Error;
|
|
239
270
|
/**
|
|
240
|
-
* An optional message
|
|
271
|
+
* An optional human-readable message describing why the configuration parsing failed.
|
|
272
|
+
* This should provide actionable information to help users fix their configuration.
|
|
241
273
|
*/
|
|
242
274
|
readonly message?: string;
|
|
243
275
|
};
|
|
@@ -256,13 +288,15 @@ export type DeleteCustomStackProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
256
288
|
/**
|
|
257
289
|
* The current state of the custom stack.
|
|
258
290
|
*/
|
|
259
|
-
readonly
|
|
291
|
+
readonly currentState: STATE;
|
|
260
292
|
/**
|
|
261
293
|
* The configuration object for the custom stack.
|
|
262
294
|
*/
|
|
263
295
|
readonly config: CONFIG;
|
|
264
296
|
/**
|
|
265
297
|
* The custom stack to be deleted.
|
|
298
|
+
*
|
|
299
|
+
* Stack provides access for stack path, name, region, and AWS credentials.
|
|
266
300
|
*/
|
|
267
301
|
readonly stack: CustomStack;
|
|
268
302
|
/**
|
|
@@ -272,21 +306,28 @@ export type DeleteCustomStackProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
272
306
|
};
|
|
273
307
|
/**
|
|
274
308
|
* Represents a successful result of deleting a custom stack.
|
|
309
|
+
*
|
|
310
|
+
* Indicates that the custom stack has been successfully removed and
|
|
311
|
+
* all associated resources have been cleaned up properly.
|
|
275
312
|
*/
|
|
276
313
|
export type SuccessFullDeleteCustomStackResult = {
|
|
277
314
|
readonly success: true;
|
|
278
315
|
};
|
|
279
316
|
/**
|
|
280
317
|
* Represents a failed result of deleting a custom stack.
|
|
318
|
+
*
|
|
319
|
+
* Provides information about why the deletion operation failed,
|
|
320
|
+
* which can help with troubleshooting and retry strategies.
|
|
281
321
|
*/
|
|
282
322
|
export type FailedDeleteCustomStackResult = {
|
|
283
323
|
readonly success: false;
|
|
284
324
|
/**
|
|
285
|
-
* An optional message
|
|
325
|
+
* An optional human-readable message describing why the deletion failed.
|
|
326
|
+
* This can provide context about partial deletions, dependency issues, or other problems.
|
|
286
327
|
*/
|
|
287
328
|
readonly message?: string;
|
|
288
329
|
/**
|
|
289
|
-
* An optional error object
|
|
330
|
+
* An optional error object containing detailed information about the deletion failure.
|
|
290
331
|
*/
|
|
291
332
|
readonly error?: Error;
|
|
292
333
|
};
|
|
@@ -305,7 +346,7 @@ export type GetChangesProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
305
346
|
/**
|
|
306
347
|
* The current state of the custom stack.
|
|
307
348
|
*/
|
|
308
|
-
readonly
|
|
349
|
+
readonly currentState: STATE;
|
|
309
350
|
/**
|
|
310
351
|
* The configuration object for the custom stack.
|
|
311
352
|
*/
|
|
@@ -320,6 +361,8 @@ export type GetChangesProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
320
361
|
readonly tags: Tags;
|
|
321
362
|
/**
|
|
322
363
|
* The custom stack to be updated.
|
|
364
|
+
*
|
|
365
|
+
* Stack provides access for stack path, name, region, and AWS credentials.
|
|
323
366
|
*/
|
|
324
367
|
readonly stack: CustomStack;
|
|
325
368
|
/**
|
|
@@ -328,32 +371,50 @@ export type GetChangesProps<CONFIG, STATE extends CustomStackState> = {
|
|
|
328
371
|
readonly ctx: StacksContext;
|
|
329
372
|
};
|
|
330
373
|
/**
|
|
331
|
-
* Represents a change in a custom stack.
|
|
374
|
+
* Represents a change detected in a custom stack.
|
|
375
|
+
*
|
|
376
|
+
* This type is used to describe individual modifications that would be made
|
|
377
|
+
* to a custom stack during an update operation. The description should be
|
|
378
|
+
* human-readable and provide enough detail for users to understand the impact.
|
|
332
379
|
*/
|
|
333
380
|
export type CustomStackChange = {
|
|
381
|
+
/**
|
|
382
|
+
* A human-readable description of the change.
|
|
383
|
+
* This should clearly explain what will be modified, added, or removed
|
|
384
|
+
* in a way that helps users understand the impact of the change.
|
|
385
|
+
*/
|
|
334
386
|
readonly description: string;
|
|
335
387
|
};
|
|
336
388
|
/**
|
|
337
|
-
* Represents a successful result of
|
|
389
|
+
* Represents a successful result of detecting changes in a custom stack.
|
|
390
|
+
*
|
|
391
|
+
* Contains an optional list of changes that would be applied to the stack.
|
|
392
|
+
* An empty or undefined changes array indicates no modifications are needed.
|
|
338
393
|
*/
|
|
339
394
|
export type SuccessfulGetChangesResult = {
|
|
340
395
|
success: true;
|
|
341
396
|
/**
|
|
342
|
-
*
|
|
397
|
+
* An optional list of changes that would be applied to the custom stack.
|
|
398
|
+
* If undefined or empty, it indicates that no changes are required.
|
|
399
|
+
* Each change describes a specific modification that would be made.
|
|
343
400
|
*/
|
|
344
401
|
changes?: ReadonlyArray<CustomStackChange>;
|
|
345
402
|
};
|
|
346
403
|
/**
|
|
347
|
-
* Represents a failed result of
|
|
404
|
+
* Represents a failed result of detecting changes in a custom stack.
|
|
405
|
+
*
|
|
406
|
+
* Indicates that the change detection process encountered an error
|
|
407
|
+
* and could not determine what modifications would be required.
|
|
348
408
|
*/
|
|
349
409
|
export type FailedGetChangesResult = {
|
|
350
410
|
success: false;
|
|
351
411
|
/**
|
|
352
|
-
* An optional message
|
|
412
|
+
* An optional human-readable message describing why change detection failed.
|
|
413
|
+
* This can help users understand what went wrong and how to resolve the issue.
|
|
353
414
|
*/
|
|
354
415
|
message?: string;
|
|
355
416
|
/**
|
|
356
|
-
* An optional error object
|
|
417
|
+
* An optional error object containing detailed information about the failure.
|
|
357
418
|
*/
|
|
358
419
|
error?: Error;
|
|
359
420
|
};
|
|
@@ -362,40 +423,117 @@ export type FailedGetChangesResult = {
|
|
|
362
423
|
*/
|
|
363
424
|
export type GetChangesResult = SuccessfulGetChangesResult | FailedGetChangesResult;
|
|
364
425
|
/**
|
|
365
|
-
* Interface
|
|
426
|
+
* Interface for handling custom stack operations in Takomo.
|
|
427
|
+
*
|
|
428
|
+
* A custom stack handler provides the core functionality for managing custom stacks
|
|
429
|
+
* throughout their lifecycle, including creation, updates, deletion, and state management.
|
|
430
|
+
* Custom stack handlers enable extending Takomo's capabilities beyond standard CloudFormation
|
|
431
|
+
* stacks to support other infrastructure provisioning tools or custom deployment logic.
|
|
432
|
+
*
|
|
433
|
+
* @template CONFIG - The configuration type for this custom stack handler
|
|
434
|
+
* @template STATE - The state type that extends CustomStackState, representing the current state of the stack
|
|
366
435
|
*/
|
|
367
436
|
export interface CustomStackHandler<CONFIG, STATE extends CustomStackState> {
|
|
368
437
|
/**
|
|
369
|
-
* The type
|
|
438
|
+
* The type identifier for this custom stack handler.
|
|
439
|
+
*
|
|
440
|
+
* This unique identifier is used to match custom stack configurations
|
|
441
|
+
* with their corresponding handler implementation. It should be a
|
|
442
|
+
* descriptive string that clearly identifies the type of infrastructure
|
|
443
|
+
* or deployment tool this handler manages.
|
|
370
444
|
*/
|
|
371
445
|
readonly type: CustomStackType;
|
|
372
446
|
/**
|
|
373
|
-
*
|
|
447
|
+
* Retrieves the current state of the custom stack from the target environment.
|
|
448
|
+
*
|
|
449
|
+
* This method is crucial for determining the stack's lifecycle operations:
|
|
450
|
+
* - During deployment: determines whether to create a new stack or update an existing one
|
|
451
|
+
* - During undeployment: determines whether a stack exists and needs to be deleted
|
|
374
452
|
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
453
|
+
* The implementation should query the actual infrastructure to determine the
|
|
454
|
+
* real state, not just return cached or assumed values.
|
|
455
|
+
*
|
|
456
|
+
* @param props - Configuration and context needed to query the stack state
|
|
457
|
+
* @returns A promise resolving to the current state or an error result
|
|
378
458
|
*/
|
|
379
459
|
readonly getCurrentState: (props: GetCurrentStateProps<CONFIG>) => Promise<GetCurrentStateResult<STATE>>;
|
|
380
460
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
461
|
+
* Analyzes and returns the changes that would be applied to bring the stack
|
|
462
|
+
* from its current state to the desired state defined by the configuration.
|
|
463
|
+
*
|
|
464
|
+
* This method is invoked during deployment of existing stacks to:
|
|
465
|
+
* - Show users what changes will be made before applying them
|
|
466
|
+
* - Determine if any changes are actually required
|
|
467
|
+
* - Enable dry-run functionality for planning purposes
|
|
468
|
+
*
|
|
469
|
+
* The implementation should compare the current stack state with the desired
|
|
470
|
+
* configuration and return a detailed list of changes that would be applied.
|
|
471
|
+
* The format and granularity of changes is up to the implementation.
|
|
472
|
+
*
|
|
473
|
+
* @param props - Current state, desired configuration, and context for comparison
|
|
474
|
+
* @returns A promise resolving to the detected changes or an error result
|
|
383
475
|
*/
|
|
384
476
|
readonly getChanges: (props: GetChangesProps<CONFIG, STATE>) => Promise<GetChangesResult>;
|
|
385
477
|
/**
|
|
386
|
-
*
|
|
478
|
+
* Validates and parses the raw configuration for this custom stack type.
|
|
479
|
+
*
|
|
480
|
+
* This method is responsible for:
|
|
481
|
+
* - Validating the configuration against the expected schema
|
|
482
|
+
* - Converting raw configuration data into a typed configuration object
|
|
483
|
+
* - Providing meaningful error messages for invalid configurations
|
|
484
|
+
* - Applying default values where appropriate
|
|
485
|
+
*
|
|
486
|
+
* The parsed configuration object will be passed to all subsequent operations,
|
|
487
|
+
* such as create, update, and delete.
|
|
488
|
+
*
|
|
489
|
+
* @param props - Raw configuration data and parsing context
|
|
490
|
+
* @returns A promise resolving to the parsed configuration or validation errors
|
|
387
491
|
*/
|
|
388
492
|
readonly parseConfig: (props: ParseConfigProps) => Promise<ParseConfigResult<CONFIG>>;
|
|
389
493
|
/**
|
|
390
|
-
* Creates a new custom stack.
|
|
494
|
+
* Creates a new instance of the custom stack in the target environment.
|
|
495
|
+
*
|
|
496
|
+
* This method should:
|
|
497
|
+
* - Provision all necessary infrastructure resources
|
|
498
|
+
* - Apply the specified parameters and tags
|
|
499
|
+
* - Return the final state of the created stack
|
|
500
|
+
*
|
|
501
|
+
* The implementation should ensure idempotency where possible and provide
|
|
502
|
+
* detailed error information if the creation fails.
|
|
503
|
+
*
|
|
504
|
+
* @param props - Configuration, parameters, tags, and context for creation
|
|
505
|
+
* @returns A promise resolving to the created stack state or an error result
|
|
391
506
|
*/
|
|
392
507
|
readonly create: (props: CreateCustomStackProps<CONFIG>) => Promise<CreateCustomStackResult<STATE>>;
|
|
393
508
|
/**
|
|
394
|
-
* Updates an existing custom stack.
|
|
509
|
+
* Updates an existing custom stack to match the desired configuration.
|
|
510
|
+
*
|
|
511
|
+
* This method should:
|
|
512
|
+
* - Apply configuration changes to the existing stack
|
|
513
|
+
* - Update parameters and tags as specified
|
|
514
|
+
* - Handle resource modifications, additions, and removals
|
|
515
|
+
* - Return the updated state of the stack
|
|
516
|
+
*
|
|
517
|
+
* The implementation should handle update conflicts gracefully and provide
|
|
518
|
+
* detailed information about what changes were actually applied.
|
|
519
|
+
*
|
|
520
|
+
* @param props - Current state, desired configuration, and context for update
|
|
521
|
+
* @returns A promise resolving to the updated stack state or an error result
|
|
395
522
|
*/
|
|
396
523
|
readonly update: (props: UpdateCustomStackProps<CONFIG, STATE>) => Promise<UpdateCustomStackResult<STATE>>;
|
|
397
524
|
/**
|
|
398
|
-
*
|
|
525
|
+
* Removes the custom stack and all its associated resources from the target environment.
|
|
526
|
+
*
|
|
527
|
+
* This method should:
|
|
528
|
+
* - Clean up all resources created by the stack
|
|
529
|
+
* - Ensure complete removal without leaving orphaned resources
|
|
530
|
+
* - Handle cases where some resources have already been deleted
|
|
531
|
+
*
|
|
532
|
+
* The implementation should be as thorough as possible in cleanup while
|
|
533
|
+
* being resilient to partial failures and resource dependencies.
|
|
534
|
+
*
|
|
535
|
+
* @param props - Current state, configuration, and context for deletion
|
|
536
|
+
* @returns A promise resolving to success or detailed error information
|
|
399
537
|
*/
|
|
400
538
|
readonly delete: (props: DeleteCustomStackProps<CONFIG, STATE>) => Promise<DeleteCustomStackResult>;
|
|
401
539
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InternalCredentialManager } from "../aws/common/credentials.js";
|
|
2
2
|
import { CustomStackHandler } from "../custom-stacks/custom-stack-handler.js";
|
|
3
3
|
import { BaseInternalStack, CustomStackType, InternalStack, Stack, StackProps } from "./stack.js";
|
|
4
|
-
export type CustomStackStatus = "PENDING" | "
|
|
4
|
+
export type CustomStackStatus = "PENDING" | "CREATE_COMPLETE" | "UPDATE_COMPLETE";
|
|
5
5
|
export interface CustomStackProps extends StackProps {
|
|
6
6
|
customType: CustomStackType;
|
|
7
7
|
customConfig: unknown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const createCustomStack = (props) => {
|
|
2
|
-
const { accountIds, commandRole, credentialManager, data, dependents, dependencies, ignore, obsolete, logger, name, parameters, path, project, region, stackGroupPath, tags, terminationProtection, timeout, schemas, customType, customConfig, customStackHandler, } = props;
|
|
2
|
+
const { uuid, accountIds, commandRole, credentialManager, data, dependents, dependencies, ignore, obsolete, logger, name, parameters, path, project, region, stackGroupPath, tags, terminationProtection, timeout, schemas, customType, customConfig, customStackHandler, } = props;
|
|
3
3
|
return {
|
|
4
|
+
uuid,
|
|
4
5
|
customType,
|
|
5
6
|
customConfig,
|
|
6
7
|
customStackHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-stack.js","sourceRoot":"","sources":["../../src/stacks/custom-stack.ts"],"names":[],"mappings":"AAoCA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,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AA;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAY,EAAwB,EAAE,CAClE,aAAa,CAAC,KAAK,CAAC,CAAA"}
|
package/dist/stacks/stack.d.ts
CHANGED
|
@@ -18,8 +18,13 @@ export type CustomStackType = string;
|
|
|
18
18
|
* Stack path.
|
|
19
19
|
*/
|
|
20
20
|
export type StackPath = string;
|
|
21
|
+
/**
|
|
22
|
+
* Unique identifier for a stack.
|
|
23
|
+
*/
|
|
24
|
+
export type StackUuid = string;
|
|
21
25
|
export type RawTagValue = string | number | boolean;
|
|
22
26
|
export interface StackProps {
|
|
27
|
+
uuid: StackUuid;
|
|
23
28
|
project?: Project;
|
|
24
29
|
path: StackPath;
|
|
25
30
|
stackGroupPath: StackGroupPath;
|
|
@@ -90,6 +95,7 @@ export interface Stack {
|
|
|
90
95
|
readonly logger: TkmLogger;
|
|
91
96
|
}
|
|
92
97
|
export interface BaseInternalStack extends Stack {
|
|
98
|
+
readonly uuid: StackUuid;
|
|
93
99
|
readonly accountIds: ReadonlyArray<AccountId>;
|
|
94
100
|
readonly commandRole?: CommandRole;
|
|
95
101
|
readonly tags: Map<TagKey, RawTagValue>;
|
package/dist/stacks/stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../src/stacks/stack.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,iBAAiB,EAEjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../src/stacks/stack.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,GACrB,MAAM,qBA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9B,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAiB,EAAE;IACtE,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAA;IACnC,CAAC;IACD,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;AACxC,CAAC,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { isCustomStack, isCustomStackProps, isInternalCustomStack, } from "./custom-stack.js";
|
|
2
2
|
export const createStandardStack = (props) => {
|
|
3
|
-
const { accountIds, capabilities, commandRole, credentialManager, data, dependents, dependencies, hooks, ignore, obsolete, logger, name, parameters, path, project, region, stackGroupPath, tags, template, templateBucket, terminationProtection, timeout, getCloudFormationClient, stackPolicy, stackPolicyDuringUpdate, schemas, } = props;
|
|
3
|
+
const { uuid, accountIds, capabilities, commandRole, credentialManager, data, dependents, dependencies, hooks, ignore, obsolete, logger, name, parameters, path, project, region, stackGroupPath, tags, template, templateBucket, terminationProtection, timeout, getCloudFormationClient, stackPolicy, stackPolicyDuringUpdate, schemas, } = props;
|
|
4
4
|
const getClient = async () => getCloudFormationClient().then((c) => c.getNativeClient());
|
|
5
5
|
const getCurrentCloudFormationStack = () => getCloudFormationClient().then((c) => c.describeStack(name));
|
|
6
6
|
return {
|
|
7
|
+
uuid,
|
|
7
8
|
accountIds,
|
|
8
9
|
capabilities,
|
|
9
10
|
commandRole,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-stack.js","sourceRoot":"","sources":["../../src/stacks/standard-stack.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"standard-stack.js","sourceRoot":"","sources":["../../src/stacks/standard-stack.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAsD1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAyB,EACF,EAAE;IACzB,MAAM,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,OAAO,EACP,MAAM,EACN,cAAc,EACd,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,qBAAqB,EACrB,OAAO,EACP,uBAAuB,EACvB,WAAW,EACX,uBAAuB,EACvB,OAAO,GACR,GAAG,KAAK,CAAA;IAET,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE,CAC3B,uBAAuB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAA;IAE5D,MAAM,6BAA6B,GAAG,GAAG,EAAE,CACzC,uBAAuB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;IAE9D,OAAO;QACL,IAAI;QACJ,UAAU;QACV,YAAY;QACZ,WAAW;QACX,iBAAiB;QACjB,IAAI;QACJ,UAAU;QACV,YAAY;QACZ,SAAS;QACT,uBAAuB;QACvB,6BAA6B;QAC7B,KAAK;QACL,MAAM;QACN,QAAQ;QACR,MAAM;QACN,IAAI;QACJ,UAAU;QACV,IAAI;QACJ,OAAO;QACP,MAAM;QACN,cAAc;QACd,IAAI;QACJ,QAAQ;QACR,cAAc;QACd,qBAAqB;QACrB,OAAO;QACP,WAAW;QACX,uBAAuB;QACvB,OAAO;QACP,cAAc,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,EAAE;QACxD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;KACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,KAAiB,EACY,EAAE,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;AAE5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,KAAoB,EACY,EAAE,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAA;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAY,EAA0B,EAAE,CACtE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -8,15 +8,16 @@ import { mergeStackSchemas } from "./merge-stack-schemas.js";
|
|
|
8
8
|
import { buildParameters } from "./parameters.js";
|
|
9
9
|
import { createCustomStack, } from "../../stacks/custom-stack.js";
|
|
10
10
|
import { buildAccountIds, buildCommandRole, buildData, buildDependencies, buildIgnore, buildObsolete, buildProject, buildRegions, buildStackName, buildTags, buildTerminationProtection, buildTimeout, validateData, validateName, validateTags, } from "./build-stack.js";
|
|
11
|
-
|
|
11
|
+
import { uuid } from "../../utils/strings.js";
|
|
12
|
+
const parseCustomStackConfig = async (stackPath, logger, handler, rawConfig) => {
|
|
12
13
|
try {
|
|
13
14
|
const result = await handler.parseConfig({
|
|
14
|
-
|
|
15
|
+
rawConfig,
|
|
15
16
|
logger,
|
|
16
17
|
stackPath,
|
|
17
18
|
});
|
|
18
19
|
if (result.success) {
|
|
19
|
-
return { customConfig: result.
|
|
20
|
+
return { customConfig: result.parsedConfig };
|
|
20
21
|
}
|
|
21
22
|
const { message, error } = result;
|
|
22
23
|
logger.error(`Parsing custom stack config failed for stack ${stackPath}: ${message}`, error);
|
|
@@ -72,6 +73,7 @@ export const buildCustomStack = async (stackPath, ctx, logger, defaultCredential
|
|
|
72
73
|
throw error;
|
|
73
74
|
}
|
|
74
75
|
const props = {
|
|
76
|
+
uuid: uuid(),
|
|
75
77
|
customType: stackConfig.customType,
|
|
76
78
|
customConfig,
|
|
77
79
|
customStackHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-custom-stack.js","sourceRoot":"","sources":["../../../src/takomo-stacks-context/config/build-custom-stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,OAAO,EACL,iBAAiB,GAGlB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EACT,0BAA0B,EAC1B,YAAY,EAEZ,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"build-custom-stack.js","sourceRoot":"","sources":["../../../src/takomo-stacks-context/config/build-custom-stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,WA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C,YAAY,CAAC,CAAA;QACpC,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;QAC1C,MAAM,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAA;QAEpD,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,MAAM,sBAAsB,CAC1D,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,WAAW,CAAC,YAAY,CACzB,CAAA;QAED,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,KAAK,CAAA;QACb,CAAC;QAED,MAAM,KAAK,GAAqB;YAC9B,IAAI,EAAE,IAAI,EAAE;YACZ,UAAU,EAAE,WAAW,CAAC,UAAU;YAClC,YAAY;YACZ,kBAAkB;YAClB,IAAI;YACJ,MAAM;YACN,UAAU;YACV,WAAW;YACX,iBAAiB;YACjB,MAAM;YACN,QAAQ;YACR,qBAAqB;YACrB,UAAU;YACV,IAAI,EAAE,SAAS;YACf,cAAc,EAAE,UAAU,CAAC,IAAI;YAC/B,OAAO;YACP,IAAI;YACJ,OAAO;YACP,YAAY;YACZ,UAAU,EAAE,EAAE;YACd,IAAI;YACJ,MAAM,EAAE,WAAW;YACnB,OAAO;SACR,CAAA;QAED,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACxD,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACxD,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;QAElD,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC,CAAC,CACL,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -12,6 +12,7 @@ import { initializeHooks } from "./hooks.js";
|
|
|
12
12
|
import { mergeStackSchemas } from "./merge-stack-schemas.js";
|
|
13
13
|
import { buildParameters } from "./parameters.js";
|
|
14
14
|
import { buildAccountIds, buildCommandRole, buildData, buildDependencies, buildHookConfigs, buildIgnore, buildObsolete, buildProject, buildRegions, buildStackName, buildTags, buildTerminationProtection, buildTimeout, validateData, validateName, validateTags, } from "./build-stack.js";
|
|
15
|
+
import { uuid } from "../../utils/strings.js";
|
|
15
16
|
const buildTemplateInternal = (stackPath, { inline, filename, dynamic }) => {
|
|
16
17
|
if (inline) {
|
|
17
18
|
return {
|
|
@@ -108,6 +109,7 @@ export const buildStandardStack = async (stackPath, ctx, logger, defaultCredenti
|
|
|
108
109
|
const templateBucket = buildTemplateBucket(builderProps);
|
|
109
110
|
const dependencies = buildDependencies(builderProps);
|
|
110
111
|
const props = {
|
|
112
|
+
uuid: uuid(),
|
|
111
113
|
name,
|
|
112
114
|
template,
|
|
113
115
|
region,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-standard-stack.js","sourceRoot":"","sources":["../../../src/takomo-stacks-context/config/build-standard-stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAa1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,mBAAmB,GAIpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAIjD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EACT,0BAA0B,EAC1B,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"build-standard-stack.js","sourceRoot":"","sources":["../../../src/takomo-stacks-context/config/build-standard-stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAa1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,mBAAmB,GAIpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAIjD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EAC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