【问题标题】:How to Update Default Compute Zone and Region of Configurations in Google Cloud Shell - CLI如何在 Google Cloud Shell 中更新默认计算区域和配置区域 - CLI
【发布时间】:2021-06-21 11:15:11
【问题描述】:

我通过gcloud init 命令创建了多个configurations。它没有让我选择设置默认计算区域或默认计算区域。

当我运行时,gcloud config configurations list,默认区域和区域是空的。

gcloud config configurations ... 仅提供以下命令。 (无更新命令)

  • 激活
  • 创建
  • 删除
  • 描述
  • 列表

我不能在初始化配置时设置默认区域和区域吗?如果不是,如何更新 gcloud 配置的某些字段?例如:COMPUTE_DEFAULT_ZONE 或 COMPUTE_DEFAULT_REGION

【问题讨论】:

    标签: google-cloud-platform configuration gcloud


    【解决方案1】:

    有一个名为 gcloud config set 的关联 gcloud 命令用于设置/更新当前活动配置中的属性。这意味着您可以创建配置,激活它,然后执行gcloud config set 命令来更改设置。查看文档,compute region 和 compute zone 都被记录为分别设置默认区域和默认区域。

    【讨论】:

      【解决方案2】:

      就像 Kolban 提到的,如果您查看设置的配置,您会发现:

      gcloud config set compute/zone [YOUR ZONE NAME HERE]
      

      示例:(gcloud 配置集计算/区域 asia-east1-b)

      另外,我喜欢同时设置区域

      gcloud config set compute/region [YOUR REGION NAME HERE]
      

      示例:(gcloud config set compute/region asia-east1)

      【讨论】:

        猜你喜欢
        • 2021-11-21
        • 1970-01-01
        • 2019-11-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多