Skip to content

Commit beb7bbd

Browse files
committed
Add debug logging for DescribeEventsCommand troubleshooting
1 parent 0eff0c8 commit beb7bbd

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

dist/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50144,7 +50144,7 @@ const core = __importStar(__nccwpck_require__(7484));
5014450144
const client_cloudformation_1 = __nccwpck_require__(3805);
5014550145
function waitUntilStackOperationComplete(params, input) {
5014650146
return __awaiter(this, void 0, void 0, function* () {
50147-
var _a, _b;
50147+
var _a, _b, _c;
5014850148
const { client, maxWaitTime, minDelay, changeSetId } = params;
5014950149
const startTime = Date.now();
5015050150
while (Date.now() - startTime < maxWaitTime * 1000) {
@@ -50177,20 +50177,22 @@ function waitUntilStackOperationComplete(params, input) {
5017750177
let failureReason = `Stack operation failed with status: ${status}`;
5017850178
if (changeSetId) {
5017950179
try {
50180+
core.info(`Attempting to get failure details for change set: ${changeSetId}`);
5018050181
const events = yield client.send(new client_cloudformation_1.DescribeEventsCommand({
5018150182
ChangeSetName: changeSetId,
5018250183
Filters: { FailedEvents: true }
5018350184
}));
50184-
const failedEvents = (_b = events.OperationEvents) === null || _b === void 0 ? void 0 : _b.filter(event => event.ResourceStatusReason);
50185+
core.info(`Retrieved ${((_b = events.OperationEvents) === null || _b === void 0 ? void 0 : _b.length) || 0} failed events`);
50186+
const failedEvents = (_c = events.OperationEvents) === null || _c === void 0 ? void 0 : _c.filter(event => event.ResourceStatusReason);
5018550187
if (failedEvents && failedEvents.length > 0) {
5018650188
const reasons = failedEvents
5018750189
.map(event => `${event.LogicalResourceId}: ${event.ResourceStatusReason}`)
5018850190
.join('; ');
5018950191
failureReason += `. Failed resources: ${reasons}`;
5019050192
}
5019150193
}
50192-
catch (_c) {
50193-
// Ignore errors getting events
50194+
catch (error) {
50195+
core.info(`Failed to get event details: ${error}`);
5019450196
}
5019550197
}
5019650198
throw new Error(failureReason);

src/deploy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ async function waitUntilStackOperationComplete(
7171
let failureReason = `Stack operation failed with status: ${status}`
7272
if (changeSetId) {
7373
try {
74+
core.info(`Attempting to get failure details for change set: ${changeSetId}`)
7475
const events = await client.send(
7576
new DescribeEventsCommand({
7677
ChangeSetName: changeSetId,
7778
Filters: { FailedEvents: true }
7879
})
7980
)
81+
core.info(`Retrieved ${events.OperationEvents?.length || 0} failed events`)
8082
const failedEvents = events.OperationEvents?.filter(
8183
event => event.ResourceStatusReason
8284
)
@@ -89,8 +91,8 @@ async function waitUntilStackOperationComplete(
8991
.join('; ')
9092
failureReason += `. Failed resources: ${reasons}`
9193
}
92-
} catch {
93-
// Ignore errors getting events
94+
} catch (error) {
95+
core.info(`Failed to get event details: ${error}`)
9496
}
9597
}
9698
throw new Error(failureReason)

0 commit comments

Comments
 (0)