通过Terraform创建具有全局复制数据功能的Cosmos DB,一小时后会超时,并显示状态码:
StatusCode = 202-原始错误:超出了上下文期限
有什么解决方案可以使Terraform成功完成吗?
我们尝试将超时操作添加到Terraform代码中,但是不支持
正在超时的Terraform代码:
resource "azurerm_resource_group" "resource_group" {
name = "${local.name}"
location = "${var.azure_location}"
tags = "${var.tags}"
}
resource "azurerm_cosmosdb_account" "db" {
name = "${local.name}"
location = "${var.azure_location}"
resource_group_name = "${azurerm_resource_group.resource_group.name}"
offer_type = "Standard"
kind = "GlobalDocumentDB"
tags = "${var.tags}"
enable_automatic_failover = false
consistency_policy {
consistency_level = "Session"
}
geo_location {
location = "${var.failover_azure_location}"
failover_priority = 1
}
geo_location {
location = "${azurerm_resource_group.resource_group.location}"
failover_priority = 0
}
}
我希望Terraform将成功完成,因为在Terraform超时后创建Cosmos DB不会出错。