首页 > 解决方案 > 使用部署管理器部署 Google Cloud Bigtable

问题描述

我正在尝试使用以下 YAML 配置文件部署 Bigtable 实例:

resources:
- name: foo-bigtable-instance
  type: bigtableadmin.v2.instance
  properties:
     name: foo
     displayName: Foo Bigtable Instance
     type: Development

当我调用gcloud deployment-manager deployments create时,出现以下错误...

ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation [operation-1545154324304-57d4f469f9081-51e37137-270e5638]: errors:
- code: MISSING_REQUIRED_FIELD
  location: /deployments/sam-poc-deployment/resources/foo-bigtable-instance->$.properties->$.parent
  message: |-
    Missing required field 'parent' with schema:
    {
      "type" : "string"
    }

什么是必需的“父”属性?该错误表明它是一个具有名为“type”的单个字段的对象。

但是“父母”代表什么?“类型”的允许值是多少?文档中未提及“父”属性。

标签: google-cloud-bigtablegoogle-deployment-manager

解决方案


您的yaml 文件中有一些错误。我相信这种修改可以解决您的问题:

resources:
- type: bigtableadmin.v2.instance
  name: foo-bigtable-instance
  properties:
    instanceId: [AN_INSTANCE_ID]
    parent: projects/[YOUR_PROJECT]
    instance:
      displayName: Foo Bigtable Instance
      type: DEVELOPMENT
    clusters:
      initial:
        defaultStorageType: HDD
        location: projects/[YOUR_PROJECT]/locations/[PREFERRED_LOCATION ]

另外,我注意到您使用的是文档,projects.instances但在这种情况下,最好使用projects.instances.create. 它包含有关实例创建和所需字段的更多信息。您也可以参考GCP 提供的关于此类操作的各种示例。


推荐阅读