Skip to content

How do I manage maintenance and security patches in Amazon DocumentDB?

3 minute read
0

I want to manage Amazon DocumentDB (with MongoDB compatibility) maintenance and security patches without disruption to my database operations.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

It's a best practice to systematically implement all Amazon DocumentDB updates during your designated maintenance windows.

Monitor pending DocumentDB maintenance events

Use the Amazon Document DB console or AWS CLI to regularly monitor pending DocumentDB maintenance events.

Also, check your email for maintenance notifications that AWS sends to the email address that's associated with your AWS account. You can view the notifications in the AWS Health Dashboard. It's a best practice to regularly check the AWS Health Dashboard to stay updated about pending maintenance.

Set up Amazon EventBridge rules to respond to the AWS_DOCDB_DB_PATCH_UPGRADE_MAINTENANCE_SCHEDULED event code. The automation handles events and captures detailed event information.

The rules initiate the following actions:

  • Additional workflows
  • Custom notifications through alternative channels
  • Alerts to AWS Console Mobile Application
  • Corrective actions or preparations for maintenance

Note: When your cluster runs on an earlier engine version, pending maintenance is typically available to upgrade the engine to the latest version.

To check the engine patch version, run the following command in the MongoDB client:

db.runCommand({ getEngineVersion: 1 })

Adjust your maintenance window

Each instance and cluster has a weekly maintenance window that Amazon MSK applies pending changes in.

When you create a cluster, Amazon DocumentDB assigns a maintenance window for both the cluster and each instance by default. It's a best practice to schedule maintenance windows during periods of lowest usage. To reschedule pending updates or temporarily skip a scheduled maintenance window, modify your cluster's or your instance’s maintenance window.

Note: Make sure that you modify the maintenance window at least 2 hours before the scheduled maintenance.

Don't regularly delay your cluster's maintenance. To make sure that the clusters have the latest security updates, Amazon MSK automatically patches clusters that you continually delay maintenance on.

Reduce downtime during operating system updates

During operating system (OS) upgrades, your Amazon DocumentDB instance experiences temporary offline periods. To minimize cluster downtime, add at least one instance read replica to your cluster. If you currently operate a single instance cluster, then add a secondary instance before maintenance begins to temporarily increase availability. After the maintenance is complete, remove the additional read replica.

Note: Standard charges apply for temporary instances.

Related information

Connect to Amazon DocumentDB

Rules in Amazon EventBridge

Release notes

AWS OFFICIALUpdated 10 months ago