gpt4 book ai didi

google-cloud-platform - 如何解决 terraform 错误 "timeout while waiting for state to become ' 完成 : true' (last state: 'done: false' , 超时 : 10m0s)"?

转载 作者:行者123 更新时间:2023-12-05 02:05:25 32 4
gpt4 key购买 nike

我正在尝试在 GCP 中使用 terraform 创建 Firestore 索引。下面是我的 Terraform 脚本:

resource "google_firestore_index" "job_config1_index" {
project = var.projectId

collection = var.job_config_firestore
depends_on = [
"google_firestore_index.job_config4_index"
]

fields {
field_path = "customer_id"
order = "ASCENDING"
}

fields {
field_path = "job_type"
order = "ASCENDING"
}

fields {
field_path = "start_date_time"
order = "ASCENDING"
}

fields {
field_path = "__name__"
order = "ASCENDING"
}
}

下面是日志:

Step #2: Error: Error waiting to create Index: Error waiting for Creating Index: timeout while waiting for state to become 'done: true' (last state: 'done: false', timeout: 10m0s)
Step #2:
Step #2: on firestore.tf line 298, in resource "google_firestore_index" "job_config1_index":
Step #2: 298: resource "google_firestore_index" "job_config1_index" {
Step #2:
Step #2:

我的其他 Firestore 索引创建良好。如何增加每个索引的超时时间?

最佳答案

一些资源,包括 google_firestore_index 资源,可以使用 timeouts block 为创建、更新和/或删除提供可选的可配置超时。 :

resource "aws_db_instance" "example" {
# ...

timeouts {
create = "60m"
delete = "2h"
}
}

因此,在您的情况下,您将向 Firestore 索引添加一个 create 超时,如下所示:

resource "google_firestore_index" "job_config1_index" {
project = var.projectId

collection = var.job_config_firestore
depends_on = [
"google_firestore_index.job_config4_index"
]

fields {
field_path = "customer_id"
order = "ASCENDING"
}

fields {
field_path = "job_type"
order = "ASCENDING"
}

fields {
field_path = "start_date_time"
order = "ASCENDING"
}

fields {
field_path = "__name__"
order = "ASCENDING"
}

timeouts {
create = "60m"
}
}

关于google-cloud-platform - 如何解决 terraform 错误 "timeout while waiting for state to become ' 完成 : true' (last state: 'done: false' , 超时 : 10m0s)"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63561091/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com