Cloud Run functions 提供两个产品版本:Cloud Run functions (第 1 代) 和通过Google Cloud Functions v2 API 创建的 Cloud Run functions 函数。如果您的组织想要限制只能使用一种版本来部署新函数,您可以使用限制条件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"]],["最后更新时间 (UTC):2025-04-21。"],[[["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."]]],[]]