To use the TDE feature, you must grant PolarDB permission to access Key Management Service (KMS). You can grant this permission in the Resource Access Management (RAM) console.
Prerequisites
You must use an Alibaba Cloud account.
1. Create the AliyunRDSInstanceEncryptionRolePolicy access policy
Log on to the Policy Management page of the RAM console.
Click Create Policy.
NoteAn access policy is a collection of permissions that uses a specific syntax to define authorized resources, operations, and conditions.
Click the JSON tab and copy the following script to the code editor.
{ "Version": "1", "Statement": [ { "Action": [ "kms:List*", "kms:DescribeKey", "kms:TagResource", "kms:UntagResource" ], "Resource": [ "acs:kms:*:*:*" ], "Effect": "Allow" }, { "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": [ "acs:kms:*:*:*" ], "Effect": "Allow", "Condition": { "StringEqualsIgnoreCase": { "kms:tag/acs:rds:instance-encryption": "true" } } } ] }Click OK. In the dialog box that appears, enter the following information:
Parameter
Description
Policy Name
Enter a policy name. Enter AliyunRDSInstanceEncryptionRolePolicy.
Description
Enter a note. For example: Used for PolarDB to access KMS.
Click OK.
2. Create and authorize the AliyunRDSInstanceEncryptionDefaultRole RAM role
After you create the policy, you must attach it to a RAM role. This allows PolarDB to access KMS resources.
Log on to the Role Management page of the RAM console.
Click Create Role.
Select Cloud Service. From the Principal Name drop-down list, select the ApsaraDB RDS option that ends with
rds.aliyuncs.com, and then click OK.In the Create Role dialog box, set Role Name to
AliyunRDSInstanceEncryptionDefaultRoleand then click OK.After the role is created, on the role details page, click the Permissions tab and then click Grant Permission.
On the Grant Permission page, search for the
AliyunRDSInstanceEncryptionRolePolicypolicy that you created. Click the policy name to move it to the Selected Policy box on the right.Click Grant Permissions.
What to do next
After you create the access policy and the RAM role, you can enable TDE for your cluster. You can also enable TDE when you create a cluster.