code: def delete_efs_by_id(efs_id):
    
    start_time = time.time()
    efs_client = get_efs_client()
    sys.stdout.write("deleting %s ... " % (efs_id,))
    while True:
      try:
        response = efs_client.delete_file_system(FileSystemId=efs_id)
        if is_good_response(response):
          print("succeeded")
          break
        time.sleep(RETRY_INTERVAL_SEC)
      except Exception as e:
        print("Failed with %s" % (e,))
        if time.time() - start_time - RETRY_INTERVAL_SEC < RETRY_TIMEOUT_SEC:
          print("Retrying in %s sec" % (RETRY_INTERVAL_SEC,))
          time.sleep(RETRY_INTERVAL_SEC)
        else:
          print("Giving up")
          break
docs: Deletion sometimes fails, try several times.