Skip to content

Commit

Permalink
Filter only recent status events back on failed cloud formation deplo…
Browse files Browse the repository at this point in the history
…yment.
  • Loading branch information
wparad committed Feb 9, 2024
1 parent 27c440f commit ef4fd18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/CloudFormationDeployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class CloudFormationDeployer {
UPDATE_ROLLBACK_FAILED: true,
ROLLBACK_FAILED: true
};
const mappedResults = eventsResponse.StackEvents.filter(event => failureStackEventStatuses[event.ResourceStatus]).map(result => ({
const mappedResults = eventsResponse.StackEvents.filter(event => new Date(Date.now() - 1000 * 600) < event.Timestamp && failureStackEventStatuses[event.ResourceStatus]).map(result => ({
cloudFormationResourceName: result.LogicalResourceId, awsResourceId: result.PhysicalResourceId, error: result.ResourceStatusReason
}));
console.error('Stack status indicates failure because of the following events: ', mappedResults);
Expand Down

0 comments on commit ef4fd18

Please sign in to comment.