Cloud Run 函式提供兩個產品版本:Cloud Run 函式 (第 1 代) 和透過Google Cloud Functions v2 API 建立的 Cloud Run 函式。如果貴機構想要強制執行限制,指定只能使用其中一個版本來部署新函式,您可以使用限制constraints/cloudfunctions.restrictAllowedGenerations 定義新的機構政策。您可以使用這項限制,在套用政策的資料夾或專案中,指定要允許或拒絕的世代 (版本)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-14 (世界標準時間)。"],[[["Cloud Run functions have two versions, 1st gen and 2nd gen, and organizations can restrict new deployments to a specific version using organization policies."],["The `constraints/cloudfunctions.restrictAllowedGenerations` constraint allows specifying which Cloud Run function version (1stGen or 2ndGen) can be used for new deployments within a folder or project."],["Setting this restriction only applies to new function deployments; existing functions can still be redeployed regardless of the policy."],["To create or modify organization policies, the account must have the `roles/orgpolicy.policyAdmin` role."],["You can use the Google Cloud CLI to enforce these restrictions by using the `gcloud resource-manager org-policies allow cloudfunctions.restrictAllowedGenerations` command."]]],[]]