Managing Amazon DocumentDB Events

Amazon DocumentDB (with MongoDB compatibility) keeps a record of events that relate to your clusters, instances, snapshots, security groups, and cluster parameter groups. This information includes the date and time of the event, the source name and source type of the event, and a message that is associated with the event.

Important

For certain management features, Amazon DocumentDB uses operational technology that is shared with Amazon RDS and Amazon Neptune. Region limits, limits that are governed at the Region level, are shared between Amazon DocumentDB, Amazon RDS, and Amazon Neptune. For more information, see Regional Quotas.

Viewing Amazon DocumentDB Event Categories

Each Amazon DocumentDB resource type has specific types of events that can be associated with it. You can use the AWS CLI describe-event-categories operation to view the mapping between event types and Amazon DocumentDB resource types.

Parameters

  • --source-type—Optional. Use the --source-type parameter to see the event categories for a particular source type. The following are permitted values:

    • db-cluster

    • db-instance

    • db-parameter-group

    • db-security-group

    • db-snapshot

    • db-cluster-snapshot

  • --filters—Optional. To view the event categories for just Amazon DocumentDB, use the filter --filter Name=engine,Values=docdb.

The following code lists the event categories associated with clusters.

For Linux, macOS, or Unix:

  1. aws docdb describe-event-categories \
  2. --filter Name=engine,Values=docdb \
  3. --source-type db-cluster

For Windows:

  1. aws docdb describe-event-categories ^
  2. --filter Name=engine,Values=docdb ^
  3. --source-type db-cluster

Output from this operation looks something like the following (JSON format).

  1. {
  2. "EventCategoriesMapList": [
  3. {
  4. "EventCategories": [
  5. "notification",
  6. "failure",
  7. "maintenance",
  8. "failover"
  9. ],
  10. "SourceType": "db-cluster"
  11. }
  12. ]
  13. }

The following code lists the event categories that are associated with each Amazon DocumentDB source type.

  1. aws docdb describe-event-categories

Output from this operation looks something like the following (JSON format).

  1. {
  2. "EventCategoriesMapList": [
  3. {
  4. "SourceType": "db-instance",
  5. "EventCategories": [
  6. "notification",
  7. "failure",
  8. "creation",
  9. "maintenance",
  10. "deletion",
  11. "recovery",
  12. "restoration",
  13. "configuration change",
  14. "read replica",
  15. "backtrack",
  16. "low storage",
  17. "backup",
  18. "availability",
  19. "failover"
  20. ]
  21. },
  22. {
  23. "SourceType": "db-security-group",
  24. "EventCategories": [
  25. "configuration change",
  26. "failure"
  27. ]
  28. },
  29. {
  30. "SourceType": "db-parameter-group",
  31. "EventCategories": [
  32. "configuration change"
  33. ]
  34. },
  35. {
  36. "SourceType": "db-snapshot",
  37. "EventCategories": [
  38. "notification",
  39. "creation",
  40. "deletion",
  41. "restoration"
  42. ]
  43. },
  44. {
  45. "SourceType": "db-cluster",
  46. "EventCategories": [
  47. "notification",
  48. "failure",
  49. "maintenance",
  50. "failover"
  51. ]
  52. },
  53. {
  54. "SourceType": "db-cluster-snapshot",
  55. "EventCategories": [
  56. "backup"
  57. ]
  58. }
  59. ]
  60. }

Viewing Amazon DocumentDB Events

You can retrieve events for your Amazon DocumentDB resources through the Amazon DocumentDB console, which shows events from the past 24 hours. You can also retrieve events for your Amazon DocumentDB resources by using the describe-events AWS CLI command, or the DescribeEvents Amazon DocumentDB API operation. If you use the AWS CLI or the Amazon DocumentDB API to view events, you can retrieve events for up to the past 14 days.

Using the AWS Management Console

To view all Amazon DocumentDB instance events for the past 24 hours

  1. Sign in to the AWS Management Console, and open the Amazon DocumentDB console at https://console.aws.amazon.com/docdb.

  2. In the navigation pane, choose Events. The available events appear in a list.

  3. Use the Filter list to filter the events by type. Enter a term in the text box to further filter your results. For example, the following screenshot shows filtering all Amazon DocumentDB events for snapshot events.

    ![

    1. Screenshot of the events section showing filtering events for snapshots.
    2. ](/projects/DocumentDB-20201111-en/46774f22299004fe05680d541e54b43f.png)

Using the AWS CLI

To view all Amazon DocumentDB instance events for the past 7 days

You can view all Amazon DocumentDB instance events for the past 7 days by running the describe-events AWS CLI operation with the --duration parameter set to 10080 (10,080 minutes).

  1. aws docdb describe-events --duration 10080

Filtering for Amazon DocumentDB Events

To see specific Amazon DocumentDB events, use the describe-events operation with the following parameters.

Parameters

  • --filter—Required to limit returned values to Amazon DocumentDB events. Use Name=engine,Values=docdb to filter all events for Amazon DocumentDB only.

  • --source-identifier—Optional. The identifier of the event source for which events are returned. If omitted, events from all sources are included in the results.

  • --source-type—Optional, unless --source-identifier is provided, then required. If --source-identifier is provided, --source-type must agree with the type of the --source-identifier. The following are permitted values:

    • db-cluster

    • db-instance

    • db-parameter-group

    • db-security-group

    • db-snapshot

    • db-cluster-snapshot

The following example lists all your Amazon DocumentDB events.

  1. aws docdb describe-events --filters Name=engine,Values=docdb

Output from this operation looks something like the following (JSON format).

  1. {
  2. "Events": [
  3. {
  4. "SourceArn": "arn:aws:rds:us-east-1:123SAMPLE012:db:sample-cluster-instance3",
  5. "Message": "instance created",
  6. "SourceType": "db-instance",
  7. "Date": "2018-12-11T21:17:40.023Z",
  8. "SourceIdentifier": "sample-cluster-instance3",
  9. "EventCategories": [
  10. "creation"
  11. ]
  12. },
  13. {
  14. "SourceArn": "arn:aws:rds:us-east-1:123SAMPLE012:db:docdb-2018-12-11-21-08-23",
  15. "Message": "instance shutdown",
  16. "SourceType": "db-instance",
  17. "Date": "2018-12-11T21:25:01.245Z",
  18. "SourceIdentifier": "docdb-2018-12-11-21-08-23",
  19. "EventCategories": [
  20. "availability"
  21. ]
  22. },
  23. {
  24. "SourceArn": "arn:aws:rds:us-east-1:123SAMPLE012:db:docdb-2018-12-11-21-08-23",
  25. "Message": "instance restarted",
  26. "SourceType": "db-instance",
  27. "Date": "2018-12-11T21:25:11.441Z",
  28. "SourceIdentifier": "docdb-2018-12-11-21-08-23",
  29. "EventCategories": [
  30. "availability"
  31. ]
  32. }
  33. ]
  34. }

For more information, see Auditing Amazon DocumentDB Events.