启用和停用 Cloud Composer 服务

Cloud Composer 1 | Cloud Composer 2 | Cloud Composer 3

本页介绍了如何在 Google Cloud 项目中启用和停用 Cloud Composer 服务。

如需了解 Google Cloud 上的服务管理,请参阅启用和停用服务

如需了解 Cloud Composer 在 VPC Service Controls 配置中所需的服务列表,请参阅配置 VPC Service Controls

启用 Cloud Composer 服务

本部分介绍如何在 Google Cloud 项目中启用 Cloud Composer 服务。

准备工作

启用 Cloud Composer API

控制台

启用 Cloud Composer API:

Enable the API

gcloud

启用 composer.googleapis.com API:

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:

    1. 暂停 DAG。
    2. 如果需要,从环境的存储桶导出环境的数据,例如 DAG。
    3. 删除您的环境,包括未自动删除的资源。

停用 Cloud Composer API

要停用 Cloud Composer 服务,请执行以下操作:

控制台

  1. 在 Google Cloud 控制台中,前往 Cloud Composer API 页面。

    转到 Cloud Composer API

  2. 点击管理

  3. 点击停用 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 名称。

后续步骤