Daniel
Daniel

Reputation: 635

unable to sepcify backup in terraform cosmodb

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

Upvotes: 1

Views: 383

Answers (1)

Marcin
Marcin

Reputation: 238557

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.

Upvotes: 1

Related Questions