Describing Amazon DocumentDB Clusters
You can use either Amazon DocumentDB Management Console or the AWS CLI to see details such as connection endpoints, security groups, VPCs, and parameter groups pertaining to your Amazon DocumentDB clusters.
For more information, see the following:
Using the AWS Management Console
Use the following procedure to view the details of a specified Amazon DocumentDB cluster using the console.
Sign in to the AWS Management Console, and open the Amazon DocumentDB console at https://console.aws.amazon.com/docdb.
In the navigation pane, choose Clusters.
Tip
If you don’t see the navigation pane on the left side of your screen, choose the menu icon () in the upper-left corner of the page.
In the list of clusters, choose the name of the cluster that you want to see the details of. The information about the cluster is organized into the following groupings:
Summary — General information about the cluster, including the engine version, cluster status, pending maintenance, and the status of its parameter group.
Connectivity & Security —The Connect section lists connection endpoints to connect to this cluster with the mongo shell or with an application. The Security Groups section lists the security groups associated with this cluster and their VPC ID and descriptions.
Configuration — The Cluster details section lists details about the cluster, including the cluster’s Amazon Resource Name (ARN), endpoint, and parameter group. It also lists the cluster’s backup information, maintenance details, and security and network settings. The Cluster instances section lists the instances that belong to this cluster with each instance’s role and cluster parameter group status.
Monitoring — The Amazon CloudWatch Logs metrics for this cluster. For more information, see Monitoring Amazon DocumentDB with CloudWatch.
Events & tags — The Recent events section lists the recent events for this cluster. Amazon DocumentDB keeps a record of events that relate to your clusters, instances, snapshots, security groups, and cluster parameter groups. This information includes the date, time, and message associated with each event. The Tags section lists the tags attached to this cluster.
Using the AWS CLI
To view the details of your Amazon DocumentDB clusters using the AWS CLI, use the describe-db-clusters
command as shown in the examples below. For more information, see DescribeDBClusters
in the Amazon DocumentDB Resource Management API Reference.
Note
For certain management features such as cluster and instance lifecycle management, Amazon DocumentDB leverages operational technology that is shared with Amazon RDS. The filterName=engine,Values=docdb
filter parameter returns only Amazon DocumentDB clusters.
Example 1: List all Amazon DocumentDB clusters
The following AWS CLI code lists the details for all Amazon DocumentDB clusters in a region.
aws docdb describe-db-clusters --filter Name=engine,Values=docdb
Output from this operation looks something like the following.
{
"DBClusters": [
{
"AvailabilityZones": [
"us-east-1c",
"us-east-1b",
"us-east-1a"
],
"BackupRetentionPeriod": 1,
"DBClusterIdentifier": "sample-cluster-1",
"DBClusterParameterGroup": "sample-parameter-group",
"DBSubnetGroup": "default",
"Status": "available",
...
},
{
"AvailabilityZones": [
"us-east-1c",
"us-east-1b",
"us-east-1a"
],
"BackupRetentionPeriod": 1,
"DBClusterIdentifier": "sample-cluster-2",
"DBClusterParameterGroup": "sample-parameter-group",
"DBSubnetGroup": "default",
"Status": "available",
...
},
{
"AvailabilityZones": [
"us-east-1c",
"us-east-1b",
"us-east-1a"
],
"BackupRetentionPeriod": 1,
"DBClusterIdentifier": "sample-cluster-3",
"DBClusterParameterGroup": "sample-parameter-group",
"DBSubnetGroup": "default",
"Status": "available",
...
}
]
}
Example 2: List all details for a specified Amazon DocumentDB cluster
The following AWS CLI code lists the details for the cluster sample-cluster
.
For Linux, macOS, or Unix:
aws docdb describe-db-clusters \
--filter Name=engine,Values=docdb \
--db-cluster-identifier sample-cluster
For Windows:
aws docdb describe-db-clusters ^
--filter Name=engine,Values=docdb ^
--db-cluster-identifier sample-cluster
Output from this operation looks something like the following.
{
"DBClusters": [
{
"AvailabilityZones": [
"us-east-1c",
"us-east-1b",
"us-east-1a"
],
"BackupRetentionPeriod": 1,
"DBClusterIdentifier": "sample-cluster",
"DBClusterParameterGroup": "sample-parameter-group",
"DBSubnetGroup": "default",
"Status": "available",
"EarliestRestorableTime": "2020-03-09T00:04:26.844Z",
"Endpoint": "sample-cluster.node.us-east-1.docdb.amazonaws.com",
"ReaderEndpoint": "sample-cluster.node.us-east-1.docdb.amazonaws.com",
"MultiAZ": false,
"Engine": "docdb",
"EngineVersion": "4.0.0",
"LatestRestorableTime": "2020-03-10T20:38:17.456Z",
"Port": 27017,
"MasterUsername": "<user-name>",
"PreferredBackupWindow": "00:00-00:30",
"PreferredMaintenanceWindow": "tue:09:50-tue:10:20",
"DBClusterMembers": [
{
"DBInstanceIdentifier": "sample-instance-1",
"IsClusterWriter": true,
"DBClusterParameterGroupStatus": "in-sync",
"PromotionTier": 1
},
{
"DBInstanceIdentifier": "sample-instance-2",
"IsClusterWriter": false,
"DBClusterParameterGroupStatus": "in-sync",
"PromotionTier": 1
},
],
"VpcSecurityGroups": [
{
"VpcSecurityGroupId": "sg-abcd0123",
"Status": "active"
}
],
"HostedZoneId": "ABCDEFGHIJKLMN",
"StorageEncrypted": true,
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"DbClusterResourceId": "cluster-ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-cluster",
"AssociatedRoles": [],
"ClusterCreateTime": "2020-01-10T22:13:38.261Z",
"EnabledCloudwatchLogsExports": [
"profiler"
],
"DeletionProtection": true
}
]
}
Example 3: List specific details for a Amazon DocumentDB cluster
To list a subset of the clusters’ details using the AWS CLI, add a --query
that specifies which cluster members the describe-db-clusters
operation is to list. The --db-cluster-identifier
parameter is the identifier for the particular cluster that you want to display the details of. For more information on queries, see How to Filter the Output with the --query
Option in the AWS Command Line Interface User Guide.
The following example lists the instances in an Amazon DocumentDB cluster.
For Linux, macOS, or Unix:
aws docdb describe-db-clusters \
--filter Name=engine,Values=docdb \
--db-cluster-identifier sample-cluster \
--query 'DBClusters[*].[DBClusterMembers]'
For Windows:
aws docdb describe-db-clusters ^
--filter Name=engine,Values=docdb ^
--db-cluster-identifier sample-cluster ^
--query 'DBClusters[*].[DBClusterMembers]'
Output from this operation looks something like the following.
[
[
[
{
"DBInstanceIdentifier": "sample-instance-1",
"IsClusterWriter": true,
"DBClusterParameterGroupStatus": "in-sync",
"PromotionTier": 1
},
{
"DBInstanceIdentifier": "sample-instance-2",
"IsClusterWriter": false,
"DBClusterParameterGroupStatus": "in-sync",
"PromotionTier": 1
}
]
]
]