import re


def IsVPCNameValid(vpc):
  """Return true if a VPC name is valid.

  https://cloud.google.com/compute/docs/reference/rest/v1/networks

  "The first character must be a lowercase letter, and all following characters
  (except for the last character) must be a dash, lowercase letter, or digit.
  The last character must be a lowercase letter or digit."

  Args:
    vpc: A string.

  Returns:
    bool: True if a VPC name matches the pattern and length requirements.
  """
  if len(vpc) < 1 or len(vpc) > 63:
    return False
  return bool(re.match('^[a-z]$|^[a-z][a-z0-9-]*[a-z0-9]$', vpc))