Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Emergency Contact

Replace unhealthy EC2 instances in Elastic Beanstalk

by Jiji Jose | Aug 29, 2021 | Amazon Web Services (AWS), Latest | 0 comments

Wondering how to replace unhealthy EC2 instances in Elastic Beanstalk? We can help you with this!

As a part of our AWS Support Services, we often receive similar requests from our AWS customers.

Today, let’s see the steps followed by our Support Techs to help our customers to replace unhealthy EC2 instances in AWS Elastic Beanstalk.

 

Replace unhealthy EC2 instances in Elastic Beanstalk

 
The Elastic Beanstalk environment’s Auto Scaling group health check configuration is set to the EC2 type which simply performs a status check of EC2 instance by default.

We can use a configuration file to automate the replacement of unhealthy EC2 instances. That is we must change the health check type of the environment’s auto-scaling group from EC2 to ELB by using a .ebextension if we want to automate the replacement of unhealthy EC2 instances.

Now let’s see the steps for changing the health check type of your instance’s Auto Scaling group to ELB by using the configuration file.
 

Change the health check type of your instance’s Auto Scaling group to ELB

 

  1. Firstly, In the root directory of our source bundle, we need to create a folder named .ebextensions.

2. Then we need to create a new .config file. For example:

Example .ebextensions/autoscaling.config
===============================================
Resources:
AWSEBAutoScalingGroup:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
HealthCheckType: ELB
HealthCheckGracePeriod: 300
===============================================

HealthCheckGracePeriod is the time that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that’s come into service.

3. Now create a zip file for our updated application source bundle, and then we need to deploy your application.

Note that we can also deploy your application using eb deploy.

Also, note that the above steps apply to environments with load balancers only.

Confirm that the health check type of Auto Scaling group is set to ELB

  1. Log in to the AWS Management console and then open the Amazon EC2 console.

2. Select Auto Scaling Groups.

3.  Then enter the environment ID of your Auto Scaling group for Filter and then select our Auto Scaling group.

4. Then we need to confirm that the Health Check Type is set to ELB on the Details tab of our Auto Scaling group.

Note the following points:

  • The status checks do not cover the health of our application, server, or any docker containers running on the instance. It covers only an EC2 instance’s health.
  • The load balancer removes the unhealthy instances from its target when the application crashes. However, the Autoscaling group won’t replace that unhealthy instance.
  • We enable the Auto Scaling group to automatically replace the unhealthy instances by changing the health check type from EC2 to ELB. When the health check fails for an instance, it will replace that unhealthy instance.

[Need help with more AWS queries? We’d be happy to assist]

 

Conclusion

 
To sum up, today we discussed the steps followed by our Support Engineers to help our customers to replace unhealthy EC2 instances in Elastic Beanstalk.

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • A 15-Minute Self-Hosted RAG Stack Tutorial: From Zero to Production
  • Designing Data Pipelines That Prevent Outages Across Global Systems
  • Deployment Automation: Deploy With Efficiency and Consistency
  • What Is Proactive Monitoring? A Complete Guide
  • AI Use Cases: How Artificial Intelligence Is Used Across Industries

Categories

  • Advanced Vulnerability
  • AI Services
  • AI Support
  • AIOps
  • Amazon Web Services (AWS)
  • Apache
  • API Integration
  • Application Development
  • Azure
  • Cloud Cost Optimization
  • Cloud Management
  • Cloud-Native Application
  • Cloudflare
  • cPanel
  • cPanel migration
  • Cyberpanel
  • DDoS
  • Development Service
  • DevOps
  • DevOps Consulting
  • DevSecOps
  • Digital Transformation
  • DigitalOcean
  • DirectAdmin
  • Docker
  • Drupal
  • Ecommerce
  • Filezilla
  • FTP
  • Google cloud platform
  • HAProxy
  • Headless CMS Integration
  • Hosting Support
  • IIS
  • Infrastructure Management & Optimization
  • Kubernetes
  • KVM
  • Laravel
  • Latest
  • Linode
  • Litespeed
  • LXC/LXD
  • Magento
  • Mobile App Development
  • MongoDB
  • Moodle
  • MySQL
  • NFS
  • Nginx
  • OnApp
  • Outsourced Support
  • OVH
  • ovirt
  • pfsense
  • Plesk
  • PostgreSQL
  • PowerDNS
  • Product Engineering
  • Proxmox
  • RedHat
  • Redis
  • Sendmail
  • Server Administration
  • Server Management
  • Software Development
  • SQLServer
  • Technical Support
  • UI/UX
  • Virtualizor
  • VMware
  • VPN
  • Vulnerability Scanning
  • Vultr
  • Web Development
  • Windows
  • WordPress
  • WordPress Hosting
  • WordPressHA

Subscribe to our newsletter

Footer newsletter

Email sales@bobcares.com | Phone 1-800-383-5193

Product Engineering

  • MVP Build
  • MVP to Scale
  • Product Maintenance

Digital Transformation

  • Process Digitization & Automation
  • Systems Integration & Workflow Orchestration
  • Data Enablement & Decision Support
  • Application & Platform Modernization
  • Transformation Execution & Delivery Enablement

AI Services

  • AI Readiness & Use-Case Discovery
  • AI Integration & Application Enablement
  • Intelligent Automation & AI Workflows

Infrastructure Management

  • Always-On Infrastructure Management
  • Proactive Monitoring & Incident Prevention
  • Cloud Cost Control & Optimization (FinOps)
  • Outsourced IT & End-User Support
  • Managed Infrastructure Execution Support

DevOps & Automation Services

  • CI/CD & Release Automation
  • Infrastructure as Code & Platform Standardization
  • Reliability Engineering & Observability
  • DevSecOps Enablement
Product Engineering +
Web Development MVP to Scale Builds Microservices Architecture Agile & Dev Team Augmentation Mobile Apps Ecommerce UI/UX Design QA & Test Automation
Digital Transformation +
Legacy Modernization Workflow Automation Data-Driven Dashboards CRM / ERP Integration Business Process Re-engineering
AI Services +
AI & Machine Learning AIOps Intelligent Automation Business Intelligence & Analytics AI Installation & Compute
Infrastructure Management +
Cloud Setup Cloud Migration Managed Cloud Services Server & Hosting Cost Optimization Performance Optimization Outsourced Support
DevOps & Automation Services +
CI/CD Setup Kubernetes & Docker Infrastructure as Code Cloud-Native Migration DevSecOps
Cybersecurity & Compliance Services +
Security Hardening VAPT Incident Response Backup & DR

© 2026 Bobcares. All Rights Reserved.

  • Careers
  • |
  • Cookie Policy
  • |
  • GDPR
  • |
  • Privacy Policy
  • |
  • Terms and Service
  • LinkedIn
  • YouTube
  • Instagram
  • Facebook

Preview of the new Bobcares experience
NEW UPDATE
See What’s New
at Bobcares

Discover a faster, clearer view of our services and expertise.


Explore the New Experience
Arrow Right