How do I list IAM users with aws cli which are older than 2 days and a prefix attached to them?
aws iam list-users | jq '.Users[] | select ( .CreateDate | contains("2019-10-10") ) | select ( .UserName | startswith("vault-") ) | .UserId'
and then you can loop over results to delete the user
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.