Azure cosmosdb continuous backup issue

Hi Team,

I am trying to deploy Azure cosmosdb (mongo) with continuous backup and when i deploy getting below error,

“Blocks of type “backup” are not expected here.”

ref: Terraform Registry

image

please provide the sample Terraform file for cosmos db with continuous backup or please help me to fix this issue.

Terraform file:

CosmosDB

resource “azurerm_cosmosdb_account” “database” {
name = “demo-{azurerm_resource_group.rg.location}-{var.env}”
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
offer_type = “Standard”
kind = “MongoDB”

lifecycle {
ignore_changes = [capabilities]
prevent_destroy = true
}

capabilities {
name = “EnableMongo”
}

consistency_policy {
consistency_level = “Session”
}

geo_location {
failover_priority = 0
location = var.cosmos_replication_location != “” ? var.cosmos_replication_location : azurerm_resource_group.rg.location
}

backup {
type = “Continuous”
}
}

resource “azurerm_cosmosdb_mongo_database” “methodology” {
account_name = azurerm_cosmosdb_account.database.name
name = “demo-methodology-{azurerm_resource_group.rg.location}-{var.env}”
resource_group_name = azurerm_resource_group.rg.name

autoscale_settings {
max_throughput = var.cosmos_autoscaling_max_throughput
}
}

You need to upgrade provider.