Home > Software engineering >  unable to sepcify backup in terraform cosmodb
unable to sepcify backup in terraform cosmodb

Time:11-19

I am using terraform to create CosmoDB , my build uses azurerm 2.56.0

resource "azurerm_cosmosdb_account" "testaccount" {
    name = "testaccount"
    location = var.location
    resource_group_name = var.rgname
    offer_type = "Standard"
    Kind = "GlobalDocumentDB"
    enable_automatic_failover = false
  
  consistent_policy {
         consistency_level = "Session"
    }
    
    backup {
         type = "Periodic"
         interval_in_minutes = "120"
         retention_in_hours = "14"
    }
}

I am getting following error Error: Unsupported block type

When I comment out the backup section, it works fine. I checked cosmosdb account https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cosmosdb_account#backup

it does seem like I have declared it correctly. I have also checked that this version of azurerm supports backups

I am probably missing something obvious, does anyone see what the problem is? Thanks Dan

CodePudding user response:

backup is not supported in 2.56.0. You are looking at newer docs. For your version, the docs are here.

If you want to use backup, you have to upgrade your provider.

  • Related