Step 2 — Writing the Lambda Function (Python)
The core logic was written in Python using boto3. It:
Lists all IAM users
Checks PasswordLastUsed
Flags users inactive for over 90 days
Saves the list in S3
Sends it as an email notification via SNS
Step 4 — Notifications and Output
A file containing the list of inactive users is automatically uploaded to S3
An email alert is sent with the same content via SNS
Here’s the !
SOCIAL SHARE CARD GENERATOR