To use the transparent data encryption (TDE) feature, you must grant PolarDB permissions to access Key Management Service (KMS). You can grant these permissions in the Resource Access Management (RAM) console.
Prerequisites
An Alibaba Cloud account is required.
Create the AliyunRDSInstanceEncryptionRolePolicy policy
Log on to the Policies page in the RAM console.
Click Create Policy.
NoteA permission policy is a set of permissions written in a specific syntax that precisely defines authorized resources, allowed operations, and authorization conditions.
Click the JSON tab and paste the following policy document into 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 and configure the following parameters:
Parameter
Description
Policy name
Enter AliyunRDSInstanceEncryptionRolePolicy.
Note
Enter a description, such as "Allows PolarDB to access KMS."
Click OK.
Create and authorize the AliyunRDSInstanceEncryptionDefaultRole RAM role
After creating the policy, attach it to a RAM role to allow PolarDB to access KMS resources.
Navigate to the Roles page in the RAM console.
Click Create Role.
For Trusted entity type, select Cloud service.
From the Trusted Entity Name dropdown list, search for and select ApsaraDB RDS / RDS, and then click OK.
Enter AliyunRDSInstanceEncryptionDefaultRole in the RAM Role Name field and click OK.
After the role is created, on the role details page, click the Permissions tab and then click Add Permissions.
On the Add Permissions page, search for and click the AliyunRDSInstanceEncryptionRolePolicy permission policy you created to add it to the Selected list.
Click OK.