Fix concurrent error in cosmosdb example (#191)

* fix concurrent error in cosmosdb example

* change to random_string to reduce the collision rate

* fix 101-cosmos-db-free-tier account name too long issue

---------

Co-authored-by: zjhe <hezijie@microsoft.com>
This commit is contained in:
lonegunmanb
2023-03-15 08:49:16 +08:00
committed by GitHub
parent c4d4d696a5
commit 2f73fa933f
13 changed files with 73 additions and 8 deletions

View File

@ -4,7 +4,7 @@ resource "azurerm_resource_group" "example" {
}
resource "azurerm_cosmosdb_account" "example" {
name = "${random_pet.prefix.id}-cosmosdb-account"
name = random_pet.prefix.id
location = var.cosmosdb_account_location
resource_group_name = azurerm_resource_group.example.name
offer_type = "Standard"

View File

@ -4,4 +4,8 @@ output "cosmosdb_account_id" {
output "cosmosdb_sql_database_id" {
value = azurerm_cosmosdb_sql_database.main.id
}
output "cosmosdb_account_name" {
value = azurerm_cosmosdb_account.example.name
}