Modifying Amazon DocumentDB Cluster Parameters

In Amazon DocumentDB, cluster parameter groups consist of parameters that apply to all of the instances that you create in the cluster. For custom cluster parameter groups, you can modify a parameter value at any time or reset all the parameter values to their defaults for parameter groups that you create. This section describes how to view the parameters that make up an Amazon DocumentDB cluster parameter group and their values, and how you can change or update these values.

Parameters can be dynamic or static. When you change a dynamic parameter and save the cluster parameter group, the change is applied immediately regardless of the Apply Immediately setting. When you change a static parameter and save the cluster parameter group, the parameter change takes effect only after you manually reboot the instances.

Viewing an Amazon DocumentDB Cluster Parameter Group’s Parameters

You can see an Amazon DocumentDB cluster’s parameters and their values using the AWS Management Console or AWS CLI.

To view the details of a cluster parameter group

  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 Parameter groups.

    Tip

    If you don’t see the navigation pane on the left side of your screen, choose the menu icon (Modifying Cluster Parameters - 图1) in the upper-left corner of the page.

  3. In the Parameter groups pane, choose the name of the cluster parameter group that you want to see the details of.

  4. The resulting page shows the following values for each parameter: the parameter’s name, current value, allowed values, whether the parameter is modifiable, apply type, data type, and description.

    ![

    1. Screenshot: Parameter names and values.
    2. ](/projects/DocumentDB-20201111-en/79c32cf401cd6a5e33b2e0ed5faac776.png)

To see a cluster’s parameter group’s parameters and their values, use the describe-db-cluster-parameters operation with the following parameters.

  • --db-cluster-parameter-group-name — Required. The name of the cluster parameter group for which you want a detailed parameter list.

  • --source — Optional. If supplied, returns only parameters for a specific source. Parameter sources can be engine-default, system, or user.

The following code lists the parameters and their values for the custom3-6-param-grp parameter group. For more information about the parameter group, omit the --query line. For information about all parameter groups, omit the --db-cluster-parameter-group-name line.

For Linux, macOS, or Unix:

  1. aws docdb describe-db-cluster-parameters \
  2. --db-cluster-parameter-group-name custom3-6-param-grp \
  3. --query 'Parameters[*].[ParameterName,ParameterValue]'

For Windows:

  1. aws docdb describe-db-cluster-parameters ^
  2. --db-cluster-parameter-group-name custom3-6-param-grp ^
  3. --query 'Parameters[*].[ParameterName,ParameterValue]'

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

  1. [
  2. [
  3. "audit_logs",
  4. "disabled"
  5. ],
  6. [
  7. "tls",
  8. "enabled"
  9. ],
  10. [
  11. "ttl_monitor",
  12. "enabled"
  13. ]
  14. ]

Modifying an Amazon DocumentDB Cluster Parameter Group’s Parameters

You can modify a parameter group’s parameters using the AWS Management Console or AWS CLI.

To update the parameters of a cluster parameter group

  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 Parameter groups.

    Tip

    If you don’t see the navigation pane on the left side of your screen, choose the menu icon (Modifying Cluster Parameters - 图2) in the upper-left corner of the page.

  3. In the Parameter groups pane, choose the cluster parameter group that you want to update the parameters of.

  4. The resulting page shows the parameters and their corresponding details for this cluster parameter group. Select a parameter to update.

  5. On the top right of the page, choose Edit to change the value of the parameter. For more information about the types of cluster parameters, see Amazon DocumentDB Cluster Parameters Reference.

  6. Make your change, and then choose Modify cluster parameter to save the changes. To discard your changes, choose Cancel.

To modify a cluster parameter group’s parameters, use the modify-db-cluster-parameter-group operation with the following parameters:

  • --db-cluster-parameter-group-name — Required. The name of the cluster parameter group that you are modifying.

  • --parameters — Required. The parameter or parameters that you are modifying. Each parameter entry must include the following:

    • ParameterName — The name of the parameter that you are modifying.

    • ParameterValue — The new value for this parameter.

    • ApplyMethod — How you want changes to this parameter applied. Permitted values are immediate and pending-reboot.

      Note

      Parameters with the ApplyType of static must have an ApplyMethod of pending-reboot.

To change the values of a cluster parameter group’s parameters (AWS CLI)

The following example changes the tls parameter.

  1. List the parameters and their values of sample-parameter-group

    For Linux, macOS, or Unix:

    1. aws docdb describe-db-cluster-parameters \
    2. --db-cluster-parameter-group-name sample-parameter-group

    For Windows:

    1. aws docdb describe-db-cluster-parameters ^
    2. --db-cluster-parameter-group-name sample-parameter-group

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

    1. {
    2. "Parameters": [
    3. {
    4. "Source": "system",
    5. "ApplyType": "static",
    6. "AllowedValues": "disabled,enabled",
    7. "ParameterValue": "enabled",
    8. "ApplyMethod": "pending-reboot",
    9. "DataType": "string",
    10. "ParameterName": "tls",
    11. "IsModifiable": true,
    12. "Description": "Config to enable/disable TLS"
    13. },
    14. {
    15. "Source": "user",
    16. "ApplyType": "dynamic",
    17. "AllowedValues": "disabled,enabled",
    18. "ParameterValue": "enabled",
    19. "ApplyMethod": "pending-reboot",
    20. "DataType": "string",
    21. "ParameterName": "ttl_monitor",
    22. "IsModifiable": true,
    23. "Description": "Enables TTL Monitoring"
    24. }
    25. ]
    26. }
  2. Modify the tls parameter so that its value is disabled. You can’t modify the ApplyMethod because the ApplyType is static.

    For Linux, macOS, or Unix:

    1. aws docdb modify-db-cluster-parameter-group \
    2. --db-cluster-parameter-group-name sample-parameter-group \
    3. --parameters "ParameterName"=tls,ParameterValue=disabled,ApplyMethod=pending-reboot"

    For Windows:

    1. aws docdb modify-db-cluster-parameter-group ^
    2. --db-cluster-parameter-group-name sample-parameter-group ^
    3. --parameters "ParameterName=tls,ParameterValue=disabled,ApplyMethod=pending-reboot"

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

    1. {
    2. "DBClusterParameterGroupName": "sample-parameter-group"
    3. }
  3. Wait at least 5 minutes.

  4. List the parameter values of sample-parameter-group.

    For Linux, macOS, or Unix:

    1. aws docdb describe-db-cluster-parameters \
    2. --db-cluster-parameter-group-name sample-parameter-group

    For Windows:

    1. aws docdb describe-db-cluster-parameters ^
    2. --db-cluster-parameter-group-name sample-parameter-group

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

    1. {
    2. "Parameters": [
    3. {
    4. "ParameterName": "audit_logs",
    5. "ParameterValue": "disabled",
    6. "Description": "Enables auditing on cluster.",
    7. "Source": "system",
    8. "ApplyType": "dynamic",
    9. "DataType": "string",
    10. "AllowedValues": "enabled,disabled",
    11. "IsModifiable": true,
    12. "ApplyMethod": "pending-reboot"
    13. },
    14. {
    15. "ParameterName": "tls",
    16. "ParameterValue": "disabled",
    17. "Description": "Config to enable/disable TLS",
    18. "Source": "user",
    19. "ApplyType": "static",
    20. "DataType": "string",
    21. "AllowedValues": "disabled,enabled",
    22. "IsModifiable": true,
    23. "ApplyMethod": "pending-reboot"
    24. }
    25. ]
    26. }