代码之家  ›  专栏  ›  技术社区  ›  Evandro Pomatti

无法同时创建多个Cosmos MongoDB集合

  •  0
  • Evandro Pomatti  · 技术社区  · 6 年前

    试图同时创建两个集合会引发以下错误:

    The specified type system value 'TypedJsonBson' is invalid.
    

    根据响应日志和错误发生在 apply 阶段,我怀疑这与API有关。

    样品:


    变通方法

    通过一次创建一个集合,可以避免此问题。

    depends_on = [
      azurerm_cosmosdb_mongo_collection.example
    ]
    
    0 回复  |  直到 6 年前
        1
  •  1
  •   Nancy Xiong    6 年前

    我试过你的地形 main.tf 我的本地PowerShell上的文件,工作正常。所以地形配置文件应该是正确的。

    enter image description here

    我建议你跑步 terraform apply Azure cloud shell .你可以把旧的 terraform.tfstate 文件和 .terraform 文件夹并重新运行 terraform init 本地或核实工作环境中的其他原因。

        2
  •  0
  •   Mark Brown    6 年前

    是的,如果Terraform有一种方法可以指定在创建子资源之前需要先存在父资源,那么您应该使用它,因为ARM需要这样才能创建任何资源。

    推荐文章