Afi.ai backup monitoring - auto-protect users & weekly health digest via Slack
Find a file
dependabot[bot] 3f99db3095
Some checks failed
Deploy / deploy (push) Has been cancelled
Bump boto3 (#20)
Bumps the minor-and-patch group with 1 update in the /src/auto_protect directory: [boto3](https://github.com/boto/boto3).


Updates `boto3` from 1.43.25 to 1.43.31
- [Release notes](https://github.com/boto/boto3/releases)
- [Commits](https://github.com/boto/boto3/compare/1.43.25...1.43.31)

---
updated-dependencies:
- dependency-name: boto3
  dependency-version: 1.43.30
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-16 17:22:58 -04:00
.github Add PR labeler caller + README badges (INFRA-56, INFRA-57) (#18) 2026-06-11 14:13:08 -04:00
src Bump boto3 (#20) 2026-06-16 17:22:58 -04:00
.gitignore Initial commit: Afi backup monitor SAM stack 2026-04-06 13:42:28 -04:00
README.md Add PR labeler caller + README badges (INFRA-56, INFRA-57) (#18) 2026-06-11 14:13:08 -04:00
template.yaml Attach permissions boundary to all Lambda roles (#17) 2026-06-10 14:15:02 -04:00

Afi Backup Monitor

CI Python AWS SAM Slack

AWS SAM stack with two Lambda functions that integrate the Afi.ai backup API with Slack.

Functions

afi-auto-protect — Runs weekly. Compares tenant resources against active protections and automatically applies the configured backup policy to any unprotected users. Posts a summary to Slack.

afi-health-digest — Runs weekly. Pulls task statistics (last 7 days), storage quotas, and resource coverage, then posts a formatted digest to Slack.

Architecture

  • Runtime: Python 3.12 (arm64)
  • Shared Layer: Afi API client + Slack webhook helper
  • Secrets: Afi API key stored in AWS Secrets Manager
  • Scheduling: EventBridge cron rules (default: Mondays 10am ET)

Setup

  1. Store the Afi API key in Secrets Manager:

    aws secretsmanager create-secret --name afi-api-key --secret-string "appkey-YOUR_KEY"
    
  2. Update samconfig.toml with your Secret ARN, Tenant ID, and Policy ID.

  3. Build and deploy:

    sam build && sam deploy
    

Manual Testing

aws lambda invoke --function-name afi-auto-protect --payload '{}' /dev/stdout
aws lambda invoke --function-name afi-health-digest --payload '{}' /dev/stdout