All Products
Document Center

ApsaraDB for MongoDB:ModifyDBInstanceTDE

Last Updated:Jan 17, 2023

You can call this operation to modify the transparent data encryption (TDE) status of an ApsaraDB for MongoDB instance.

Operation Description

TDE can be used to perform real-time I/O encryption and decryption on data files. Data is encrypted before being written to disks, and decrypted before being read from disks to the memory. For more information, see Configure TDE.

Note After TDE is enabled, it cannot be disabled.

Before you call this operation, make sure that the following requirements are met:

  • A replica set or sharded cluster instance is used.
  • The storage engine of the instance is WiredTiger.
  • The database engine version of the instance is 4.0 or 4.2. If the database engine version is earlier than 4.0, you can call the UpgradeDBInstanceEngineVersion operation to upgrade the database engine.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All resources is used in the Resource type column of the operation.
  • Condition keyword: refers to the condition keyword defined by the cloud product itself.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operate access level Resource type conditional keyword Association operation
dds:ModifyDBInstanceTDE WRITE
  • MongoDB

Request parameters

Parameter Type Required Description Example
DBInstanceId string Yes

The ID of an instance.

TDEStatus string Yes

The TDE status. Set the value to Enabled.

Note Exercise caution when enabling TDE. After TDE is enabled, it cannot be disabled.
EncryptorName string No

The encryption method. Set the value to AES-256-CBC.

Note This parameter is valid only when you specify the TEDStatus parameter to enabled.
EncryptionKey string No

The custom key.

RoleARN string No

The ARN of the role. It is in the format of acs:ram::$accountID:role/$roleName.

  • $accountID: indicates the ID of the Alibaba Cloud account that owns the RAM role. To view the account ID, log on to the Alibaba Cloud Management Console, move your pointer over your profile picture in the upper-right corner, and then click Security Settings.
  • $roleName: indicates the name of the RAM role. To view the RAM role name, perform the following steps: Log on to the RAM console. In the left-side navigation pane, click RAM Roles. In the RAM Role Name column on the page that appears, you can view the name of the RAM role.
  • acs:ram::123456789012****:role/adminrole

    Response parameters

    Parameter Type Description Example
    RequestId string

    The ID of the request.



    Normal return example


      "RequestId": "434D7127-6229-4355-BA50-7A3685A725DF"

    Error codes

    Http code Error code Error message
    400 UnsupportedDBTdeStatus Specified DB TDEStatus does not support this operation.
    403 UnsupportedEngine Current DB Instance engine does not support this operation.
    403 IncorrectCharacterType Current DB instance CharacterType does not support this operation.
    403 IncorrectEngineVersion Current engine version does not support operations.
    403 IncorrectDBInstanceState Current DB instance state does not support this operation.
    403 IncorrectDBInstanceLockMode Current DB instance lock mode does not support this operation.
    404 InvalidClusterKms this cluster not kms service.
    404 InvalidParam Specified parameters is not valid.

    For a list of error codes, visit the API error center.