本頁面中的部分或全部資訊可能不適用於 Trusted Cloud by S3NS。
命名資源
本頁面說明 Compute Engine 資源的命名慣例。
資源是構成 Cloud 服務或產品的基本元件。舉例來說,Compute Engine 上的資源包括但不限於:
如要進一步瞭解資源,請參閱全球、區域和區域資源說明文件。
在 Compute Engine 上建立新資源時,您必須提供資源的名稱等屬性。
對於 Compute Engine 上的資源,資源名稱必須符合下列格式 (除非在建立該資源的說明文件中另有指定):
- 長度介於 1 至 63 個字元之間。
- 遵循 RFC 1035 慣例。
- 符合規則運算式
^[a-z]([-a-z0-9]*[a-z0-9])?
。也就是說,第一個字元必須是小寫英文字母,後續的所有字元則須由連字號、小寫英文字母或數字組成,但最後一個字元不得為連字號。
名稱唯一性
一般來說,資源名稱在專案內的某個位置中不得重複。舉例來說,外部 IP 位址名稱在所在區域內不得重複。不過,您可以在不同位置重複使用名稱。
如果 Compute Engine 專案資源的 vmDnsSetting
設定未設為 ZonalOnly
,則專案中的所有 VM 名稱都必須不重複。我們強烈建議為專案使用 vmDnsSetting:ZonalOnly
設定,這樣不僅可在區域和區域之間重複使用 VM 名稱,還能將 DNS 註冊中的失敗狀況隔離至個別區域,進而提高可靠性。詳情請參閱「區域 DNS 名稱」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-06-16 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-06-16 (世界標準時間)。"],[[["This page outlines the naming conventions for Compute Engine resources, which are fundamental components of the cloud service."],["Resource names must be 1-63 characters long, adhere to RFC 1035 conventions, and follow a specific regular expression pattern starting with a lowercase letter and excluding hyphens as the last character."],["Resource names must generally be unique within a location in a project, but they can be reused across different locations."],["When `vmDnsSetting` is not set to `ZonalOnly`, all VM names must be unique across the project, whereas using `ZonalOnly` allows name reuse and provides higher reliability."]]],[]]