我正在尝试使用terraform脚本在Azure中构建一个基础架构。它由k8s,API网关,子网,Cosmos数据库,SQL服务器等组成。 $
I m trying to use the terraform scripts to build one infrastructure in Azure. It consists of k8s, API gateway,subnet,Cosmos db ,SQL server etc..
我正在应用该计划并破坏计划(terraform步骤) )。当我第一次建造一切都很好,破坏也很好。但是,当我第二次建立时,我得到低于两个错误
I m applying the plan and also destroying the plan (terraform steps). When first time i m building everything builds fine and destroying also works fine. But when i m building second time i get below two error
错误:
* azurerm_cosmosdb_account.XXXXXX:1错误( s)发生: * azurerm_cosmosdb_account.XXXXXX:CosmosDB帐户XXXXXX已经存在,请通过terraform import导入资源 * azurerm_sql_server.YYYYYY:发生1个错误: * azurerm_sql_server.YYYYYY:等待SQL Server"YYYYYY"的创建/更新未来时出错(资源组"mygroup"):Code =" NameAlreadyExists" Message ="名称'YYYYYY'已经存在。选择一个不同的名称。"
但是当检查我的资源组时,我找不到cosmosDB帐户( XXXXXX )和SQL服务器( YYYYYY )。我不确定这些名字是如何得到验证的。我使用az cosmosdb delete和az sql server delete来删除这些资源。执行删除cli命令后,我尝试构建terraform脚本仍然是我得到XXXXXX和YYYYYY已经存在。每次我们应该创建和销毁这些资源时,这是一个devops脚本。但是,如果我面对这个问题,那么我每次都应该更改cosmodb帐户名和sql server名称,而不是自动化。
But when check my resource group i cant find cosmosDB account (XXXXXX ) and SQL server(YYYYYY) . I m not sure how these names have been verified. I used az cosmosdb delete and az sql server delete explicitly to delete these resources. After executing the delete cli commands , I tried to build the terraform scripts still i get XXXXXX and YYYYYY already exists. This is an devops scripts each time we should create and destroy these resources. But if i face this issue, then each and every time i should change the cosmodb account name and sql server name which is not automation at all.
你能不能帮帮我吧用这个?
Could you please help me with this?
注意: XXXXXX和 YYYYYY是公司,项目和一些非常独特的数字组合的复杂名称。
谢谢,
Swathi S
Swathi S
推荐答案
Hello Swathi
Hello Swathi
再次删除和重新配置它们之间的持续时间是多长?
What is the time duration between deleting and reprovisioning them again?
结构可能需要一段时间才能完全解除后端资源的分配。
It could take a while for the fabric to completely de-allocate the resources in the backend.
更多推荐
Azure Cosmos DB帐户已存在
发布评论