ec2-ttl-alert

Deploys a Lambda, SNS, and EventBridge workflow that alerts on missing or expired EC2 TTL tags.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/amitkarpe/agent-skills --skill ec2-ttl-alert-amitkarpe
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ec2-ttl-alert
Source: https://github.com/amitkarpe/agent-skills/tree/main/skills/ec2-ttl-alert
Command: npx skills add https://github.com/amitkarpe/agent-skills --skill ec2-ttl-alert-amitkarpe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires boto3, and includes scripts (resource) components.

What problem does it solve? EC2 instances without proper TTL (time-to-live) tags accumulate silently, leading to forgotten resources and uncontrolled cloud costs. This Skill automates daily detection of missing, invalid, expired, or soon-to-expire TTL tags so teams can review and clean up instances before they become waste. ## Core Features & Use Cases - One-command deployment: A single Bash script provisions the SNS topic, IAM role, Lambda function, and EventBridge daily schedule in one AWS account. - Daily TTL scanning: The Python Lambda scans running and stopped instances and reports missing, invalid, expired, or soon-expiring TTL tags via SNS email. - Configurable alerts: Environment variables control warning window, email recipients, and resource names. - Use Case: A platform engineer wants a daily email listing all EC2 instances in one AWS account whose TTL tag has expired or is missing, without deploying a full monitoring stack. ## Quick Start Ask the agent to deploy the EC2 TTL alert workflow to your AWS profile using the deploy script, then confirm the SNS email subscription and review the test invocation output.

Frequently Asked Questions about ec2-ttl-alert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up daily alerts for expired EC2 TTL tags?▼

Run the deploy script with your AWS profile and optional region: bash scripts/deploy-ec2-ttl-alert.sh <profile> [region]. It creates the SNS topic, IAM role, Lambda function, and EventBridge daily rule, then runs a test invocation. Set TTL_ALERT_EMAILS to subscribe email addresses.

How do I monitor EC2 instances missing TTL tags with Lambda?▼

The included ttl_checker.py Lambda scans running and stopped instances via the EC2 describe_instances paginator and flags instances with missing, invalid, expired, or soon-expiring TTL tags. Findings are published to an SNS topic as a grouped email report.

Can this Lambda scan multiple AWS accounts for TTL tags?▼

No, the skill is single-account by default and scans only the account of the profile used at deploy time. Cross-account scanning would require adding assume-role logic, which the documentation explicitly states is not included.

What TTL tag format does the EC2 checker expect?▼

The Lambda expects a TTL tag in YYYY-MM-DD date format. Tags that are missing, unparseable, already expired, or expiring within the WARN_DAYS window (default 3 days) are included in the SNS alert.

Why is no SNS alert email sent after deployment?▼

The Lambda only publishes to SNS when at least one finding exists; if all instances have valid TTL tags, it logs a message and returns without sending. Also confirm the SNS email subscription, since email subscriptions require manual confirmation before delivery.