Modifying an Amazon DocumentDB Instance - Amazon DocumentDB

Modifying an Amazon DocumentDB Instance

You can modify your Amazon DocumentDB instance using either the AWS Management Console or the AWS CLI. To modify an instance, the instance must be in the available state. You cannot modify an instance that is stopped. If the cluster is stopped, first start the cluster, wait for the instance to become available, and then make the desired modifications. For more information, see Stopping and Starting an Amazon DocumentDB Cluster.

Using the AWS Management Console

Follow these steps to modify a specific Amazon DocumentDB instance using the console.

  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 Instances.

    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.

  3. Specify the instance that you want to modify by choosing the button to the left of the instance name.

  4. Choose Actions, and then choose Modify.

  5. In the Modify instance: <instance-name> pane, make the changes that you want. You can make the following changes:

    • Instance specifications — The instance identifier and class. Instance identifier naming constraints:

      • Must contain [1—63] alphanumeric characters or hyphens.

      • First character must be a letter.

      • Cannot end with a hyphen or contain two consecutive hyphens.

    • Certificate authority — Server certificate for this instance. For more information, see Updating Your Amazon DocumentDB TLS Certificates.

    • Failover — During failover, the instance with the highest promotion tier will be promoted to primary. For more information, see Amazon DocumentDB Failover.

    • Maintenance — The maintenance window in which pending modifications or patches are applied to instances in the cluster.

  6. When you have finished, choose Continue to see a summary of your changes.

  7. After verifying your changes, you can apply them immediately or during the next maintenance window under Scheduling of modifications. Choose Modify instance to save your changes. Alternatively, you can choose Cancel to discard your changes.

It takes a few minutes for your changes to be applied. You can use the instance only when its status is available. You can monitor the instance's status using the console or AWS CLI. For more information, see Monitoring an Amazon DocumentDB Instance's Status.

Using the AWS CLI

The following code modifies the instance class to db.r5.xlarge for the instance sample-instance.

Parameters

  • --db-instance-identifier — Required. The identifier for the instance to be modified.

  • --apply-immediately or --no-apply-immediately — Optional. Specifies whether this modification should be applied immediately or wait until the next maintenance window. If this parameter is omitted, the modification is performed during the next maintenance window.

For Linux, macOS, or Unix:

aws docdb modify-db-instance \ --db-instance-identifier sample-instance \ --db-instance-class db.r5.4xlarge \ --apply-immediately

For Windows:

aws docdb modify-db-instance ^ --db-instance-identifier sample-instance ^ --db-instance-class db.r5.4xlarge ^ --apply-immediately

Output from this operation looks something like the following.

{ "DBInstances": [ { "DBInstanceIdentifier": "sample-instance-1", "DBInstanceClass": "db.r5.large", "Engine": "docdb", "DBInstanceStatus": "modifying", "Endpoint": { "Address": "sample-instance-1.node.us-east-1.docdb.amazonaws.com", "Port": 27017, "HostedZoneId": "ABCDEFGHIJKLM" }, "InstanceCreateTime": "2020-01-10T22:18:55.921Z", "PreferredBackupWindow": "02:00-02:30", "BackupRetentionPeriod": 1, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-abcd0123", "Status": "active" } ], "AvailabilityZone": "us-east-1a", "DBSubnetGroup": { "DBSubnetGroupName": "default", "DBSubnetGroupDescription": "default", "VpcId": "vpc-abcd0123", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-abcd0123", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-abcd0123", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "sun:10:57-sun:11:27", "PendingModifiedValues": { "DBInstanceClass": "db.r5.4xlarge" }, "EngineVersion": "3.6.0", "AutoMinorVersionUpgrade": true, "PubliclyAccessible": false, "DBClusterIdentifier": "sample-cluster", "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "DbiResourceId": "db-ABCDEFGHIJKLMNOPQRSTUVWXYZ", "CACertificateIdentifier": "rds-ca-2019", "PromotionTier": 1, "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:sample-instance-1", "EnabledCloudwatchLogsExports": [ "profiler" ] } ] }

It takes a few minutes for your modifications to be applied. You can use the instance only when its status is available. You can monitor the instance's status using the AWS Management Console or AWS CLI. For more information, see Monitoring an Amazon DocumentDB Instance's Status.