aws iam generate-service-last-accessed-details
Generates a report that includes details about when an IAM resource (user, group, role, or policy) was last used in an attempt to access Amazon Web Services services. AWS CLI reference
2 options Its page in the AWS CLI reference
Options
--arnThe ARN of the IAM resource (user, group, role, or managed policy) used to generate information about when the resource was last used in an attempt to access an Amazon Web Services service.--granularityThe level of detail that you want to generate.