aws / aws-health-tools

The samples provided in AWS Health Tools can help users to build automation and customized alerting in response to AWS Health events.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to test the health of an AWS service?

jonassteinberg1 opened this issue · comments

I am aware there is a public dashboard and I am aware PHD and the Health API. Still, I don't believe there is a way to GET https://ssm.us-east-1.amazonaws.com/health_status, e.g and be returned something like {"health_status": "ssm is healthy"}? It would be nice not to have to assume that an AWS service is up or to have to look at a dashboard before my service proceeds to make calls to that service. Thanks.

Hello Jonas,

If you have Enterprise or Business Support, you can use the AWS Health API[1] to check for open events impacting your resources. Use the DescribeEvents operation (or DescribeEventsForOrganization if you are a user of Organizational View[2]) and filter on the fields you're looking for. You should at minimum specify the following to ensure the event is in-progress and impacting the service in question.

Example:

aws health describe-events --filter \
    '{
        "eventStatusCodes": [
            "open"
        ],
        "eventTypeCategories": [
            "issue"
        ],
        "services": [
            "EC2"
        ],
        "regions": [
            "us-east-1"
        ]
    }'

This is the closest to what you are looking for, although I realize it is not exact. Please let me know if you have other questions.

[1] https://docs.aws.amazon.com/health/latest/APIReference/API_DescribeEvents.html
[2] https://docs.aws.amazon.com/health/latest/ug/aggregate-events.html