'alert if an active access key hasn\'t been used in 90 days'

def check_access_key_last_used(self, iamuser_item):

    akeys = iamuser_item.config.get('AccessKeys', {})
    for akey in akeys:
        if ('Status' in akey):
            if (akey['Status'] == 'Active'):
                last_used_str = akey.get('LastUsedDate')
                if (not last_used_str):
                    continue
                last_used_date = parser.parse(last_used_str)
                if (last_used_date < self.ninety_days_ago):
                    notes = 'Key:    [{}]    Last    Used:    {}'.format(akey, last_used_str)
                    self.add_issue(1, 'Active    accesskey    unused    in    last    90    days.', iamuser_item, notes=notes)
