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
241 stars 167 forks source link

[Bug]: backup_compliance_policy resource missing required attribute #1800

Closed gperiard closed 7 months ago

gperiard commented 8 months ago

Is there an existing issue for this?

Provider Version

v1.14.0

Terraform Version

v1.5.4

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

The documentation for mongodbatlas_backup_compliance_policy mentions that the following arguments have defaults when unspecified:

Documentation for pit_enabled

pit_enabled - Flag that indicates whether the cluster uses Continuous Cloud Backups with a Backup Compliance Policy. If unspecified, this value defaults to false.

Reference

Terraform configuration to reproduce the issue

resource "mongodbatlas_backup_compliance_policy" "backup_compliance_policy" {
  project_id                 = mongodbatlas_project.pod_project[0].id
  authorized_email           = "###"
  copy_protection_enabled    = true
  pit_enabled                = true
  # encryption_at_rest_enabled = false
...
}

Steps To Reproduce

  1. Do not specify a one of the mentionned value when declaring a mongodbatlas_backup_compliance_policy resource.
  2. Plan/Apply

Logs

|
│ Error: Missing required argument
│ 
│   on backup.tf line 50, in resource "mongodbatlas_backup_compliance_policy" "backup_compliance_policy":
│   50: resource "mongodbatlas_backup_compliance_policy" "backup_compliance_policy" {
│ 
│ The argument "encryption_at_rest_enabled" is required, but no definition was found.
|


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
github-actions[bot] commented 8 months ago

Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:

The ticket CLOUDP-220487 was created for internal tracking.

andreaangiolillo commented 8 months ago

Hello @gperiard 👋 , Thanks for opening the issue.

I was able to reproduce the issue. The fix will be available in the next provider release. Thanks

andreaangiolillo commented 7 months ago

Hello @gperiard 👋 The fix is available with the latest TF release. Feel free to reopen the issue if using the latest provider version does not fix the issue on your side. Thanks!