Skip to content

Commit

Permalink
Add comment for startupPeriodSeconds
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed May 1, 2024
1 parent c6b6450 commit 23b74d8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ export class MigrationServiceCore extends Stack {

if (props.maxUptime) {
let maxUptimeSeconds = Math.max(props.maxUptime.toSeconds(), Duration.minutes(5).toSeconds());

// This sets the minimum time that a task should be running before considering it healthy.
// This is needed because we don't have health checks configured for our service containers.
// We can reduce it lower than 30 seconds, and possibly remove it, but then we increase the delay
// between the current task being shutdown and the new task being ready to take work. This means
// health checks for this container will fail initially and startPeriod will stop ECS from treating
// failing health checks as unhealthy during this period.
let startupPeriodSeconds = 30;
// Add a separate container to monitor and fail healthcheck after a given maxUptime
const maxUptimeContainer = serviceTaskDef.addContainer("MaxUptimeContainer", {
Expand Down

0 comments on commit 23b74d8

Please sign in to comment.