-
Notifications
You must be signed in to change notification settings - Fork 40
How to Resolve "EC2 Failing Instances" Alerts
Mitchell Alessio edited this page Sep 28, 2023
·
11 revisions
- Access to the CMS VPN
- Access to AWS
- An installation of the AWS CLI that is configured properly for access to the BFD/CMS AWS account
- An installation of
jq
-
Run the following command in
bashorzsh:failed_instances="$(aws ec2 describe-instance-status --query 'InstanceStatuses[?SystemStatus.Status==`impaired` || InstanceStatus.Status==`impaired`]')"; [[ -n "${failed_instances#\[\]}" ]] && echo $failed_instances && aws ec2 describe-instances --no-cli-pager --query 'Reservations[].Instances[].[InstanceId,Tags[?Key==`Name`]| [0].Value]' --output table --instance-ids $(jq -n -r '$in.[].InstanceId' --argjson in "$failed_instances")
This command will output a list, in JSON, of all of the EC2 instances that have failed their EC2 Status Checks. Additionally, a table of Instance IDs to friendly names will be printed at the end.
- Home
- For BFD Users
- Making Requests to BFD
- API Changelog
- Migrating to V2 FAQ
- Synthetic and Synthea Data
- BFD SAMHSA Filtering