mirror of
https://github.com/Sea-Haven-Industries/afi-backup-monitor.git
synced 2026-09-30 04:53:11 +00:00
Afi.ai backup monitoring - auto-protect users & weekly health digest via Slack
|
Some checks failed
Deploy / deploy (push) Has been cancelled
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> |
||
|---|---|---|
| .github | ||
| src | ||
| .gitignore | ||
| README.md | ||
| template.yaml | ||
Afi Backup Monitor
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
-
Store the Afi API key in Secrets Manager:
aws secretsmanager create-secret --name afi-api-key --secret-string "appkey-YOUR_KEY" -
Update
samconfig.tomlwith your Secret ARN, Tenant ID, and Policy ID. -
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