1 Answer
- Newest
- Most votes
- Most comments
0
Use a Rolling Deployment with Batch Size = 1 (or small) By default, Elastic Beanstalk’s rolling deployments can terminate old instances before new ones are ready to run cron jobs. You want to invert that:
.ebextensions/rolling-deploy.config
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: Rolling
# Launch 1 new instance, wait until healthy, then terminate 1 old one
BatchSize: 1
BatchSizeType: Count
# Give ample time for your cron daemon to start & register “healthy”
HealthCheckGracePeriod: 300
BatchSize: 1 + BatchSizeType: Count Launch exactly one new instance, wait for it to pass health checks (including your cron daemon startup), then terminate one old.
HealthCheckGracePeriod: 300 (5 minutes) Prevents EB from marking the new instance unhealthy just because cron hasn’t yet “woken up.”
With this in place, you won’t have a window where all old instances are blocked and no new instance is ready.
answered a year ago
Relevant content
asked 3 years ago
asked 3 years ago
