Skip to content

Commit

Permalink
fix(experimental-ec2-pattern): Suspend alarm notifications
Browse files Browse the repository at this point in the history
A scale-in event fires during a rolling update can cause service disruption.
Suspend scaling events during a rolling update for safety.
  • Loading branch information
akash1810 committed Sep 13, 2024
1 parent dbd59af commit 94e81c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/experimental/patterns/__snapshots__/ec2-app.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ exports[`The GuEc2AppExperimental pattern matches the snapshot 1`] = `
"MinInstancesInService": 1,
"MinSuccessfulInstancesPercent": 100,
"PauseTime": "PT5M",
"SuspendProcesses": [],
"SuspendProcesses": [
"AlarmNotification",
],
"WaitOnResourceSignals": true,
},
},
Expand Down
9 changes: 8 additions & 1 deletion src/experimental/patterns/ec2-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ export class GuEc2AppExperimental extends GuEc2App {
minInstancesInService: minimumInstances,
minSuccessPercentage: 100,
waitOnResourceSignals: true,
suspendProcesses: [],

/*
If a scale-in event fires during an `AutoScalingRollingUpdate` operation, the update could fail and rollback.
For this reason, we suspend the `AlarmNotification` process, else availability of a service cannot be guaranteed.
Consequently, services cannot scale-out during deployments.
If AWS ever supports suspending scale-out and scale-in independently, we should allow scale-out.
*/
suspendProcesses: [ScalingProcess.ALARM_NOTIFICATION],
}),
});

Expand Down

0 comments on commit 94e81c9

Please sign in to comment.