def get_version_by_value(context, value):
  """
  Get the latest version that matches the provided ami-id
  Args:
    context: a populated EFVersionContext object
    value: the value of the version to look for
  """
  versions = get_versions(context)
  for version in versions:
    if version.value == value:
      return version
  fail("Didn't find a matching version for: "
       "{}:{} in env/service: {}/{}".format(
          context.key, value,
          context.env, context.service_name))