计算管理组资源创建后GCloud实例列表不刷新,count.index为1个元素的字符串集合

问题描述 投票:0回答:0

对于给这个群带来的不便,我深表歉意,但我有一个小问题。在 Google Cloud 中配置 VM 集群后,我将尝试检索 IP。创建“google_compute_instance_group_manager”资源后,我尝试通过数据源使用计数检索创建的实例数。然而,我遇到了一个错误:

│ │ count.index 为 1 │ │ data.google_compute_instance_group.mig.instances 是一组包含 1 个元素的字符串

我尝试了各种方法来解决这个问题,最新的方法似乎是最好的,它使用脚本并等待返回的实例数与 cluster_size 匹配。你对可能发生的事情有什么想法吗?似乎即使如此,当我使用数据源 'google_compute_instance.data "google_compute_instance" "instance_in_mig' 查询它时,实例数也没有反映出来,如果我再次运行应用程序,它就可以工作。 我会提前感谢您的帮助: 这是我的代码:(the attached image)

terraform devops gcloud
© www.soinside.com 2019 - 2024. All rights reserved.