Skip to content

Commit

Permalink
added backup in azurerm_cosmosdb_account
Browse files Browse the repository at this point in the history
  • Loading branch information
hadiulla committed Nov 1, 2024
1 parent cf4f9d3 commit 25e16c8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions modules/databases/cosmos_dbs/cosmosdb_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ resource "azurerm_cosmosdb_account" "cosmos_account" {
name = capabilities.value
}
}

dynamic "backup" {
for_each = try(var.settings.backup, null) != null ? [var.settings.backup] : []

content {
type = backup.value.type
tier = try(backup.value.tier, null)
interval_in_minutes = try(backup.value.interval_in_minutes, null)
retention_in_hours = try(backup.value.retention_in_hours, null)
storage_redundancy = try(backup.value.storage_redundancy, null)
}
}

dynamic "restore" {
for_each = try(var.settings.restore, null) != null ? [var.settings.restore] : []
content {
Expand All @@ -71,5 +84,3 @@ resource "azurerm_cosmosdb_account" "cosmos_account" {
}
}
}


0 comments on commit 25e16c8

Please sign in to comment.