sst 2.0.0-rc.67 → 2.0.0-rc.68
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/cli/ui/deploy.js +7 -6
- package/package.json +1 -1
- package/sst.mjs +17 -6
- package/stacks/monitor.js +7 -0
package/cli/ui/deploy.js
CHANGED
|
@@ -14,8 +14,7 @@ export const DeploymentUI = (props) => {
|
|
|
14
14
|
const bus = useBus();
|
|
15
15
|
const event = bus.subscribe("stack.event", (payload) => {
|
|
16
16
|
const { event } = payload.properties;
|
|
17
|
-
if (event.ResourceType === "AWS::CloudFormation::Stack")
|
|
18
|
-
return;
|
|
17
|
+
// if (event.ResourceType === "AWS::CloudFormation::Stack") return;
|
|
19
18
|
setResources((previous) => {
|
|
20
19
|
if (Stacks.isFinal(event.ResourceStatus)) {
|
|
21
20
|
const readable = logicalIdToCdkPath(props.assembly, event.StackName, event.LogicalResourceId);
|
|
@@ -23,7 +22,9 @@ export const DeploymentUI = (props) => {
|
|
|
23
22
|
? Colors.dim(`${stackNameToId(event.StackName)} ${readable} ${event.ResourceType}`)
|
|
24
23
|
: Colors.dim(`${stackNameToId(event.StackName)} ${event.ResourceType}`), Stacks.isFailed(event.ResourceStatus)
|
|
25
24
|
? Colors.danger(event.ResourceStatus)
|
|
26
|
-
: Colors.dim(event.ResourceStatus), Stacks.isFailed(event.ResourceStatus) && event.ResourceStatusReason
|
|
25
|
+
: Colors.dim(event.ResourceStatus), Stacks.isFailed(event.ResourceStatus) && event.ResourceStatusReason
|
|
26
|
+
? event.ResourceStatusReason
|
|
27
|
+
: "");
|
|
27
28
|
const { [event.LogicalResourceId]: _, ...next } = previous;
|
|
28
29
|
return next;
|
|
29
30
|
}
|
|
@@ -67,7 +68,7 @@ export const DeploymentUI = (props) => {
|
|
|
67
68
|
};
|
|
68
69
|
export function printDeploymentResults(assembly, results, remove) {
|
|
69
70
|
// Print success stacks
|
|
70
|
-
const success = Object.entries(results).filter(([_stack, result]) =>
|
|
71
|
+
const success = Object.entries(results).filter(([_stack, result]) => Stacks.isSuccess(result.status));
|
|
71
72
|
if (success.length) {
|
|
72
73
|
Colors.gap();
|
|
73
74
|
Colors.line(Colors.success(`✔`), Colors.bold(remove ? ` Removed:` : ` Deployed:`));
|
|
@@ -84,12 +85,12 @@ export function printDeploymentResults(assembly, results, remove) {
|
|
|
84
85
|
Colors.gap();
|
|
85
86
|
}
|
|
86
87
|
// Print failed stacks
|
|
87
|
-
const failed = Object.entries(results).filter(([_stack, result]) =>
|
|
88
|
+
const failed = Object.entries(results).filter(([_stack, result]) => Stacks.isFailed(result.status));
|
|
88
89
|
if (failed.length) {
|
|
89
90
|
Colors.gap();
|
|
90
91
|
Colors.line(`${Colors.danger(`✖`)} ${Colors.bold.dim(`Errors`)}`);
|
|
91
92
|
for (const [stack, result] of failed) {
|
|
92
|
-
Colors.line(` ${Colors.dim(stackNameToId(stack))}`);
|
|
93
|
+
Colors.line(` ${Colors.dim(stackNameToId(stack))} ${Colors.dim(result.status)}`);
|
|
93
94
|
for (const [id, error] of Object.entries(result.errors)) {
|
|
94
95
|
const readable = logicalIdToCdkPath(assembly, stack, id) || id;
|
|
95
96
|
Colors.line(` ${Colors.danger.bold(readable + ":")} ${error}`);
|
package/package.json
CHANGED
package/sst.mjs
CHANGED
|
@@ -1353,6 +1353,17 @@ async function monitor(stack) {
|
|
|
1353
1353
|
event,
|
|
1354
1354
|
stackID: stack
|
|
1355
1355
|
});
|
|
1356
|
+
if (event.ResourceStatusReason) {
|
|
1357
|
+
if (event.ResourceStatusReason.includes(
|
|
1358
|
+
"Resource creation cancelled"
|
|
1359
|
+
) || event.ResourceStatusReason.includes(
|
|
1360
|
+
"Resource update cancelled"
|
|
1361
|
+
) || event.ResourceStatusReason?.includes(
|
|
1362
|
+
"Resource creation Initiated"
|
|
1363
|
+
))
|
|
1364
|
+
continue;
|
|
1365
|
+
errors[event.LogicalResourceId] = event.ResourceStatusReason;
|
|
1366
|
+
}
|
|
1356
1367
|
}
|
|
1357
1368
|
}
|
|
1358
1369
|
Logger.debug("Last event set to", lastEvent);
|
|
@@ -5331,7 +5342,7 @@ import { Box, Text } from "ink";
|
|
|
5331
5342
|
import inkSpinner from "ink-spinner";
|
|
5332
5343
|
function printDeploymentResults(assembly, results, remove4) {
|
|
5333
5344
|
const success = Object.entries(results).filter(
|
|
5334
|
-
([_stack, result]) =>
|
|
5345
|
+
([_stack, result]) => stacks_exports.isSuccess(result.status)
|
|
5335
5346
|
);
|
|
5336
5347
|
if (success.length) {
|
|
5337
5348
|
Colors.gap();
|
|
@@ -5354,13 +5365,15 @@ function printDeploymentResults(assembly, results, remove4) {
|
|
|
5354
5365
|
Colors.gap();
|
|
5355
5366
|
}
|
|
5356
5367
|
const failed = Object.entries(results).filter(
|
|
5357
|
-
([_stack, result]) =>
|
|
5368
|
+
([_stack, result]) => stacks_exports.isFailed(result.status)
|
|
5358
5369
|
);
|
|
5359
5370
|
if (failed.length) {
|
|
5360
5371
|
Colors.gap();
|
|
5361
5372
|
Colors.line(`${Colors.danger(`\u2716`)} ${Colors.bold.dim(`Errors`)}`);
|
|
5362
5373
|
for (const [stack, result] of failed) {
|
|
5363
|
-
Colors.line(
|
|
5374
|
+
Colors.line(
|
|
5375
|
+
` ${Colors.dim(stackNameToId(stack))} ${Colors.dim(result.status)}`
|
|
5376
|
+
);
|
|
5364
5377
|
for (const [id, error2] of Object.entries(result.errors)) {
|
|
5365
5378
|
const readable = logicalIdToCdkPath(assembly, stack, id) || id;
|
|
5366
5379
|
Colors.line(` ${Colors.danger.bold(readable + ":")} ${error2}`);
|
|
@@ -5427,8 +5440,6 @@ var init_deploy2 = __esm({
|
|
|
5427
5440
|
const bus = useBus();
|
|
5428
5441
|
const event = bus.subscribe("stack.event", (payload) => {
|
|
5429
5442
|
const { event: event2 } = payload.properties;
|
|
5430
|
-
if (event2.ResourceType === "AWS::CloudFormation::Stack")
|
|
5431
|
-
return;
|
|
5432
5443
|
setResources((previous2) => {
|
|
5433
5444
|
if (stacks_exports.isFinal(event2.ResourceStatus)) {
|
|
5434
5445
|
const readable = logicalIdToCdkPath(
|
|
@@ -5444,7 +5455,7 @@ var init_deploy2 = __esm({
|
|
|
5444
5455
|
`${stackNameToId(event2.StackName)} ${event2.ResourceType}`
|
|
5445
5456
|
),
|
|
5446
5457
|
stacks_exports.isFailed(event2.ResourceStatus) ? Colors.danger(event2.ResourceStatus) : Colors.dim(event2.ResourceStatus),
|
|
5447
|
-
stacks_exports.isFailed(event2.ResourceStatus) && event2.ResourceStatusReason
|
|
5458
|
+
stacks_exports.isFailed(event2.ResourceStatus) && event2.ResourceStatusReason ? event2.ResourceStatusReason : ""
|
|
5448
5459
|
);
|
|
5449
5460
|
const { [event2.LogicalResourceId]: _, ...next } = previous2;
|
|
5450
5461
|
return next;
|
package/stacks/monitor.js
CHANGED
|
@@ -78,6 +78,13 @@ export async function monitor(stack) {
|
|
|
78
78
|
event: event,
|
|
79
79
|
stackID: stack,
|
|
80
80
|
});
|
|
81
|
+
if (event.ResourceStatusReason) {
|
|
82
|
+
if (event.ResourceStatusReason.includes("Resource creation cancelled") ||
|
|
83
|
+
event.ResourceStatusReason.includes("Resource update cancelled") ||
|
|
84
|
+
event.ResourceStatusReason?.includes("Resource creation Initiated"))
|
|
85
|
+
continue;
|
|
86
|
+
errors[event.LogicalResourceId] = event.ResourceStatusReason;
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
Logger.debug("Last event set to", lastEvent);
|