Cloud Composer 3 | Cloud Composer 2 | Cloud Composer 1
本页面介绍如何在 Google Cloud 项目中启用和停用 Cloud Composer 服务。
如需了解 Google Cloud上的服务管理,请参阅启用和停用服务。
如需查看 Cloud Composer 在 VPC Service Controls 配置中所需的服务列表,请参阅配置 VPC Service Controls。
启用 Cloud Composer 服务
本部分介绍如何在 Google Cloud 项目中启用 Cloud Composer 服务。
准备工作
要启用 Cloud Composer 服务,您必须具有正确的 Identity and Access Management 权限。如需了解 Service Usage 的 IAM 要求,请参阅访问权限控制的 Service Usage 页面。
确保您的项目已启用结算功能。
启用 Cloud Composer API
控制台
启用 Cloud Composer API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which
contains the serviceusage.services.enable permission. Learn how to grant
roles.
gcloud
启用 composer.googleapis.com API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which contains the
serviceusage.services.enable permission. Learn how to grant
roles.
gcloud services enable composer.googleapis.com
API
使用 services.enable 方法启用 composer.googleapis.com API。
Terraform
使用 google_project_service 资源配置 composer.googleapis.com API。
停用 Cloud Composer 服务
本部分介绍如何在 Google Cloud 项目中停用 Cloud Composer 服务。
准备工作
要停用 Cloud Composer 服务,您必须具有正确的 Identity and Access Management 权限。如需了解 Service Usage 的 IAM 要求,请参阅访问权限控制的 Service Usage 页面。
确保项目中的所有 Cloud Composer 环境都已删除。停用 API 会永久删除 Cloud Composer 环境的租户项目部分,并且这些环境将变得不可用。
为避免产生额外费用,请先针对每个环境完成以下步骤,然后再停用 Cloud Composer API:
- 暂停 DAG。
- 如果需要,从环境的存储桶导出环境的数据,例如 DAG。
- 删除您的环境,包括未自动删除的资源。
停用 Cloud Composer API
要停用 Cloud Composer 服务,请执行以下操作:
控制台
在 Google Cloud 控制台中,前往 Cloud Composer API 页面。
点击管理。
点击停用 API。
gcloud
运行 gcloud services disable 命令:
gcloud services disable composer.googleapis.com
API
使用 services.disable 方法停用 composer.googleapis.com API。
Terraform
移除 composer.googleapis.com API 的配置。您通常使用 google_project_service 资源配置 Google Cloud 服务。
Cloud Composer 所需的服务
本部分介绍了 Cloud Composer 所需的服务。在某些情况下,组织或项目管理员可以限制其项目中使用哪些 Google 服务。
Cloud Composer 需要以下服务:
- artifactregistry.googleapis.com
- cloudbuild.googleapis.com
- composer.googleapis.com
- compute.googleapis.com
container.googleapis.com
deploymentmanager.googleapis.com
logging.googleapis.com
cloudkms.googleapis.com(如果您使用的是 Cloud KMS 或 CMEK 密钥)
monitoring.googleapis.com
pubsub.googleapis.com
storage.googleapis.com
secretmanager.googleapis.com(如果您使用 Secret Manager 作为 Secret 后端)
cloudresourcemanager.googleapis.com
servicedirectory.googleapis.com
默认情况下,大多数项目都已允许使用 Cloud DNS 或 IAM 等 Google 服务。
此外,还允许使用 DAG 所用的所有服务,例如:
- bigquery.googleapis.com
- dataflow.googleapis.com
- datacatalog.googleapis.com
您可以在 API 浏览器页面中链接的 API 页面中找到服务的 *.googleapis.com 名称。
即将弃用 Cloud Composer 3 不需要的服务
我们计划逐步淘汰 Cloud Composer 3 不需要的 API:
自 2026 年 2 月 27 日起,以下 API 将完全可分离。停用这些 API 不会导致 Cloud Composer API 停用。
- artifactregistry.googleapis.com
- cloudbuild.googleapis.com
- container.googleapis.com
- pubsub.googleapis.com
- sqladmin.googleapis.com
自 2026 年 5 月 27 日起,启用 Cloud Composer API 时,这些 API 将不再自动启用。如需在新项目中创建 Cloud Composer 2 环境,必须手动启用一组分离的 API。
如果项目已启用 Cloud Composer API,则其中的现有 Cloud Composer 3 和 Cloud Composer 2 环境不会受到影响。您可以执行以下操作:
2026 年 2 月 27 日之后,如果您的项目只有 Cloud Composer 3 环境,则可以手动停用分离的 API。
2026 年 2 月 27 日之后,如果您的项目中有 Cloud Composer 2 环境,建议您保持这些 API 处于启用状态,因为停用它们可能会导致环境出现故障。
2026 年 5 月 27 日之后,如果您使用自动化脚本来预配 Cloud Composer 2 环境,请确保除了 Cloud Composer API 之外,还启用了所列的 API。