code: def rotate(args, credentials):
      
      current_access_key_id = credentials.get(
          args.identity_profile, 'aws_access_key_id')
  
      # create new sessions using the MFA credentials
      session, session3, err = make_session(args.target_profile)
      if err:
          return err
      iam = session3.resource('iam')
  
      # find the AccessKey corresponding to the identity profile and delete it.
      current_access_key = next((key for key
                                 in iam.CurrentUser().access_keys.all()
                                 if key.access_key_id == current_access_key_id))
      current_access_key.delete()
  
      # create the new access key pair
      iam_service = session3.client('iam')
      new_access_key_pair = iam_service.create_access_key()["AccessKey"]
  
      print("Rotating from %s to %s." % (current_access_key.access_key_id,
                                         new_access_key_pair['AccessKeyId']),
            file=sys.stderr)
      update_credentials_file(args.aws_credentials,
                              args.identity_profile,
                              args.identity_profile,
                              credentials,
                              new_access_key_pair)
      print("%s profile updated." % args.identity_profile, file=sys.stderr)
  
      return OK
docs: rotate the identity profile's AWS access key pair.