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 169 forks source link

Receiving invalid attribute error on terraform apply with MongoDB Atlas Maintenance Window resource #1223

Open ammarasheikh opened 1 year ago

ammarasheikh commented 1 year ago

Hi, I am receiving below error while trying to configure a maintenance window with number of deferrals. Error: error updating the MongoDB Atlas Maintenance Window (64820379c00d74100eafcd2e): PATCH https://cloud.mongodb.com/api/atlas/v1.0/groups/64820379c00d74100eafcd2e/maintenanceWindow: 400 (request "INVALID_ATTRIBUTE") Invalid attribute numberOfDeferrals specified.

Terraform CLI and Terraform MongoDB Atlas Provider Version

# Copy-paste your version info here

Terraform Configuration File

# Copy-paste your configuration info here

maintenance_window = { day_of_week = 3 hour_of_day = 4 number_of_deferrals = 1

defer = true

 #auto_defer                  = true 
 #auto_defer_once_enabled     = true would be triggered.

}

Steps to Reproduce

Expected Behavior

Actual Behavior

Debug Output

Crash Output

Additional Context

References

github-actions[bot] commented 1 year ago

Thanks for opening this issue. The ticket INTMDB-859 was created for internal tracking.

Zuhairahmed commented 1 year ago

hi @ammarasheikh can you attempt to create this resource without providing number_of_deferrals parameters in your Terraform Script as an interim solution and let us know if that works? we are waiting on longer term fix for this parameter and will share updates on this issue when they come in. thank you.

ammarasheikh commented 1 year ago

@Zuhairahmed it works fine if I don't provide number_of_deferrals So I assume it is a known issue? Do you have an ETA when it will be fixed? Please let me know. Thanks

Zuhairahmed commented 1 year ago

@ammarasheikh for more details on how to use this resource see our docs here: https://www.mongodb.com/docs/atlas/tutorial/cluster-maintenance-window/

Would highlight that users can defer a single Atlas project maintenance event up to two times. Hence the number_of_deferrals parameter should simply be a tracker of the number of deferrals that a user has made and generally not something that a user should be able to adjust directly. We are exploring ways in how best to update this in our Terraform resource and will update this ticket once an ideal solution has been found. Hope this helps. Internal tracking INTMDB-703

ammarasheikh commented 1 year ago

@Zuhairahmed thanks for providing more information.