This page describes the naming convention for Compute Engine resources.
Resources are the fundamental components that make up a Cloud service orproduct. For example, resources on Compute Engine include but are notlimited to:
- Disks anddisk snapshots
- Images and image families
- Instance templates
- Instance groups
- Machine images
- Node groups and node templates
- Compute Engine instances
To learnmore about resources, seeGlobal, regional, and zonal resources documentation.
Naming convention
When you create a new resource on Compute Engine, you have to provideproperties such as a name for the resource.
For resources on Compute Engine, the resourcename must meet the following format (unless specified differently in thedocumentation for creating that resource):
- Be 1-63 characters in length.
- Comply withRFC 1035 conventions.
- Match the regular expression
^[a-z]([-a-z0-9]*[a-z0-9])?
. This means thatthe first character must be a lowercase letter, and all the followingcharacters must be hyphens, lowercase letters, or digits, except the lastcharacter, which cannot be a hyphen.
Name uniqueness
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 whereit resides. However, you can reuse names across locations.
If the vmDnsSetting
setting for the Compute Engine project resource isn'tset to ZonalOnly
then all VM names must be unique across the project. Westrongly recommend using the vmDnsSetting:ZonalOnly
setting for yourprojects, not only so you can reuse VM names across zones and regions, but alsobecause it offers higher reliability by isolating failures in the DNSregistration to individual zones. For more information, seeZonal DNS names.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-10 UTC.
[{ "type": "thumb-down", "id": "hardToUnderstand", "label":"Hard to understand" },{ "type": "thumb-down", "id": "incorrectInformationOrSampleCode", "label":"Incorrect information or sample code" },{ "type": "thumb-down", "id": "missingTheInformationSamplesINeed", "label":"Missing the information/samples I need" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]