mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
242 stars 168 forks source link

mongodbatlas_cloud_backup_schedule does not support multiple weekly/monthly policies #748

Closed cecheta closed 2 years ago

cecheta commented 2 years ago

According to the MongoDB Atlas docs, it should be possible to have more than one weekly or monthly cloud backup policy, but this is not possible with the mongodbatlas_cloud_backup_schedule resource. It is possible in the MongoDB Atlas console.

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform v1.0.9
on darwin_amd64
+ provider registry.terraform.io/mongodb/mongodbatlas v1.3.1

Terraform Configuration File

resource "mongodbatlas_cloud_backup_schedule" "backup" {
  project_id   = var.project_id
  cluster_name = var.cluster_name

  policy_item_weekly {
    frequency_interval = 4
    retention_unit     = "weeks"
    retention_value    = 3
  }

  policy_item_weekly {
    frequency_interval = 5
    retention_unit     = "weeks"
    retention_value    = 5
  }
}

Steps to Reproduce

  1. terraform init
  2. terraform plan

Expected Behavior

Successul plan

Actual Behavior

╷
│ Error: Too many policy_item_weekly blocks
│ 
│   on main.tf line 269, in resource "mongodbatlas_cloud_backup_schedule" "backup":
│  269:   policy_item_weekly {
│ 
│ No more than 1 "policy_item_weekly" blocks are allowed
╵

The same occurs for multiple policy_item_monthly blocks.

themantissa commented 2 years ago

@cecheta you are correct. Let me have the team take a look at this.

themantissa commented 2 years ago

Internal ticket INTMDB-335

martinstibbe commented 2 years ago

@cecheta This should be corrected now in the latest release 1.4.3