Reports AWS maintenance windows
Project description
AWS maintenance window reporter
Name
aws-maintenance-windows - reports upcoming maintenance actions and windows
Synopsis
aws-maintenance-windows [--send-metrics]
Options
--send-metrics - send the metrics to DataDog
Description
This utility counts the number of upcoming maintenance actions and active maintenance windows across EC2, RDS, Redshift and Opensearch. If --send-metrics is specified, the metrics are send to DataDog. This allows you to create alerts to notift you whenever a maintenance windows is pending.
The metrics send are:
- aws.pending.maintenance.actions - number of available maintenance actions
- aws.pending.maintenance.windows - number of scheduled maintenance windows
the metrics will be tagged with the aws service name and the following resource ids:
- domainid (opensearch)
- dbinstanceidentifier (rds)
- dbclusteridentifier (rds)
- instance-id (ec2)
- clusteridentifier (opensearch)
These tags are in accordance with the AWS tags defined by DataDog for the respective resources.
Examples
$ aws-maintenance-windows
INFO: Maintenance window of ec2 instance-id i-22222222222222222: The instance is running on degraded hardware on 2022-03-28 00:00:00+00:00
INFO: Maintenance window of rds dbclusteridentifier db: Upgrade to Aurora PostgreSQL 2.9.2 on 2022-03-16 04:00:00+00:00
INFO: Maintenance action available for opensearch domainid es: A newer release R20211203-P4 is available.
INFO: Maintenance windows of opensearch domainid es-2: An update to release R20211203-P5 has been requested and is pending. Before the update starts, you can cancel it any time on 2022-03-20 00:00:00+00:00
Environment
DD_API_KEY - specifies the Datadog API key. if the value has the prefix ssm:// the api key will be retrieved by name the SSM Parameter Store eg (ssm://datadog-api-key) DATADOG_TAGS - additional datadog tags to add to the metric in the form key:value,key2:value,...
Alternatives
The AWS Health services also provides insight into scheduled changes. The AWS Health API is only available for accounts with a support contract.
Install
To install the AWS maintenance window reporter, type:
pip install aws-maintenance-window-reporter
Deploy
To deploy the maintenance window reporter as an AWS Lambda, type:
git clone https://github.com/binxio/aws-maintenance-window-reporter.git
cd aws-maintenance-window-reporter
read -p 'DD API key SSM parameter name >' PARAMETER_NAME
aws cloudformation deploy \
--capabilities CAPABILITY_IAM \
--stack-name aws-maintenance-window-reporter \
--template-file ./cloudformation/aws-maintenance-window-reporter.yaml \
--parameter-overrides DataDogAPIKeyParameterName=PARAMETER_NAME
This will install the maintenance window reporter in your AWS account and run every hour.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for aws-maintenance-window-reporter-0.2.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bc3177da6821bd2688933c3497573f49f808bc28d9793b934888b9609114e84 |
|
MD5 | 2ba28087fb1bec1eaddef7b6d8b363ba |
|
BLAKE2b-256 | 68599eb36f98c9db4d157904921642b4bf4bcf3fadad582a7d0b1c050db469e8 |