Testing your AWS IAM Users for Activity using Lambda

Recently we’ve been going through our AWS account security for compliance reasons. We needed a process that deactivates accounts that are not active for a certain amount of time. I knew I wanted to use something on Lambda to have it run on a schedule for me automatically, but I wasn’t impressed with what I could find online (most only worked on password date).