This page describes the naming convention for Compute Engine resources.
Resources are the fundamental components that make up a Cloud service or product. For example, resources on Compute Engine include but are not limited to:
- Disks and persistent disk snapshots
- Instance templates
- Instance groups
- Machine images
- Node groups and node templates
- VM instances (VMs)
To learn more about resources, see Global, regional, and zonal resources documentation.
When you create a new resource on Compute Engine, you have to provide properties such as a name for the resource.
For resources on Compute Engine, the resource name must meet the following format (unless specified differently in the documentation for creating that resource):
- Be 1-63 characters in length.
- Comply with RFC 1035 conventions.
- Match the regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?. This means that the first character must be a lowercase letter, and all the following characters must be hyphens, lowercase letters, or digits, except the last character, which cannot be a hyphen.
In general, resource names must be unique within a location within a project. For example, an external IP address name must be unique within the region where it resides. However, you can reuse names across locations.
VmDnsSetting setting for your instance is not set to
your VM instance names must be unique across the project. We strongly
recommend using the
VmDnsSetting:ZonalOnly setting for your projects, not
only so you can reuse VM names across locations, but also because it offers
higher reliability guarantees by isolating failures in the DNS registration to
individual zones. For more information, see
Zonal DNS names.