AWS Reserved Capacity Notifier avatar
AWS Reserved Capacity Notifier

Pricing

Pay per usage

Go to Apify Store
AWS Reserved Capacity Notifier

AWS Reserved Capacity Notifier

Developed by

Marek Hauschwitz

Marek Hauschwitz

Maintained by Community

Retrieve AWS DynamoDB reserved capacities and Compute Savings Plans using the AWS SDK add post a summary message to a Slack channel via a Slack bot.

0.0 (0)

Pricing

Pay per usage

0

1

1

Last modified

21 hours ago

AWS Reserved Capacity & Savings Plan Notifier

This Apify Actor retrieves AWS DynamoDB reserved capacities and Compute Savings Plans using the AWS SDK, then posts a summary message to a Slack channel via a bot.

Installation

For development a Makefile is provided.

PY_EXE=python3.13 make install

make install command with create a virtual environment -m venv and install development dependencies. (To install production dependencies only use pip install -r requirements.txt.)

You can configure the Python executable, that will be used when creating the venv with the PY_EXE env variable.

make lint

This will run some linting tools and return with exit code 1 when any of them fail:

  • mypy
  • flake8
  • isort

To run the Actor locally first enter the venv with . ./venv/bin/activate and then use the Apify CLI and provide a valid input. (e.g. apify run --input-file=./input.json)

Features

  • Fetches:
    • DynamoDB Reserved Capacity details
    • Compute Savings Plans (with expiration and commitment details)
  • Detects and highlights upcoming expirations
  • Sends a formatted notification to a Slack channel using a bot
    • 3 rounds of notifications (dates configurable) - LONG, SHORT and URGENT
    • "urgent" notification period = notifications get sent every day before resource expiration
  • Fully configurable via Actor input

Input Configuration

! Make sure the Slack app has the following permissions:

  • chat:write
  • users:read
  • users:read.email

The Actor expects the following JSON input:

{
"days_urgent": 3,
"days_reminder_short": 14,
"days_reminder_long": 30,
"ignored_uuids": ["5002de99-8a0f-45bf-8e1a-4c6b58cb26e4"],
"aws_access_key_id": "ASDIOUHB53OJLK",
"aws_secret_access_key": "********************************",
"slack_bot_token": "********************************",
"aws_account_region": "us-east-1",
"slack_channel_id": "ASDKJGKJ24123UZH",
"default_owner": "someone@example.com",
"store_name": "slack-notifications",
"target_resource": "dynamodb_reserved_capacity"
}
FieldTypeRequiredDescription
aws_access_key_idstringyesAWS Access Key ID with permissions to query Savings Plans and DynamoDB Reserved Capacity.
aws_secret_access_keystringyesAWS Secret Access Key.
aws_account_regionstringyesRegion of the AWS account.
slack_bot_tokenstringyesSlack Bot OAuth token (used to send messages via the Slack API).
slack_channel_idstringyesID of the Slack channel where notifications should be posted.
days_reminder_longnumberyesHow many days before the resource expiration to send the FIRST notification notifications.
days_reminder_shortnumberyesHow many days before the resource expiration to send the SECOND notification notifications.
days_urgentnumberyesNumber of days before expiration to mark an item as urgent and spam notifications every day (default: 3).
target_resourcestringyesWhich AWS savings resource to monitor.
ignored_uuidsstring[]noUUIDs of resources to ignore (not to send notificatons about)
default_ownerstringnoThe email address of the default owner to tag in the notification. (if not present in tags.owner)
store_namestringnoName of the key-value store in which to store the UUIDs of already notified resources.