如何找到 GCP 服务的相互依赖性

how to find GCP services interdependencies

在我可以使用特定服务之前,我必须在我的 Google 项目中启用 API。有时,当我这样做时,会启用比我指定的服务更多的服务。例如,启用 cloudfunctions 服务实际上在后台启用多个 APIs,如 pubsub、存储等

我按照这篇文章找到了服务依赖项https://binx.io/blog/2020/10/03/how-to-find-google-cloud-platform-services-dependencies/。上面文章中的命令输出显示依赖服务如下

gcloud services list \
   --available --format json | \
jq --arg service cloudfunctions.googleapis.com \
    'map(select(.config.name == $service)| 
        { 
          name:      .config.name, 
          dependsOn: .dependencyConfig.dependsOn
        }
    )'

结果是:

{
  "name": "cloudfunctions.googleapis.com",
  "dependsOn": [
    "cloudfunctions.googleapis.com",
    "logging.googleapis.com",
    "pubsub.googleapis.com",
    "source.googleapis.com",
    "storage-api.googleapis.com",
    "storage-component.googleapis.com"
  ]
}

当我执行这个命令时,我没有得到上面的输出。 ""dependsOn":" 部分显示为 "null" 下面是我在 cloudshell 中执行时相同命令的输出。

  {
    "name": "cloudfunctions.googleapis.com",
    "dependsOn": null
  }
]

是否有任何替代方法来识别服务相互依赖性。有人可以帮忙吗

我在我的系统上没有看到命令输出的 dependencyConfig 部分。

当我查看 API documentation, the Service 资源时不包含 dependencyConfig.

部分

看来 Google 已经从命令 gcloud services list 用来显示服务信息的 API 中删除了那个项目。