本文為您介紹RDS服務關聯角色的應用場景以及如何刪除服務關聯角色。
背景信息
RDS當前支持的服務關聯角色:
RDS MySQL服務關聯角色(AliyunServiceRoleForRds)
RDS PostgreSQL服務關聯角色(AliyunServiceRoleForRdsPgsqlOnEcs)
RDS PostgreSQL Proxy數據庫代理服務關聯角色(AliyunServiceRoleForRDSProxyOnEcs)
服務關聯角色是在某些情況下,為了完成RDS自身的某個功能,需要獲取其他云服務的訪問權限,而提供的RAM角色。更多關于服務關聯角色的信息請參見服務關聯角色。
服務關聯角色介紹
AliyunServiceRoleForRds
角色名稱
AliyunServiceRoleForRds
角色權限策略
AliyunServiceRolePolicyForRds
權限詳情
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateNetworkInterface",
"ecs:DeleteNetworkInterface",
"ecs:AttachNetworkInterface",
"ecs:DetachNetworkInterface",
"ecs:DescribeNetworkInterfaces",
"ecs:CreateNetworkInterfacePermission",
"ecs:DescribeNetworkInterfacePermissions",
"ecs:CreateSecurityGroup",
"ecs:DeleteSecurityGroup",
"ecs:DescribeSecurityGroupAttribute",
"ecs:DescribeSecurityGroups",
"ecs:ModifySecurityGroupAttribute",
"ecs:AuthorizeSecurityGroup",
"ecs:AuthorizeSecurityGroupEgress",
"ecs:RevokeSecurityGroup",
"ecs:RevokeSecurityGroupEgress",
"ecs:DescribeKeyPairs",
"ecs:ModifyImageSharePermission",
"ecs:DescribeImages"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"vpc:DescribeVSwitches",
"vpc:AssociateEipAddress",
"vpc:DescribeVpcs"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": "ram:DeleteServiceLinkedRole",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
"ram:ServiceName": "rds-ecs-service.rds.aliyuncs.com"
}
}
}
]
}
創建角色
該角色用于RDS MySQL數據庫授權,您可以在創建數據庫時,根據控制臺提示進行創建,更多信息,請參見創建數據庫。
刪除角色
如果您需要刪除服務關聯角色,需要先刪除依賴這個服務角色的所有數據庫。
AliyunServiceRoleForRdsPgsqlOnEcs
角色名稱
AliyunServiceRoleForRdsPgsqlOnEcs
角色權限策略
AliyunServiceRolePolicyForRdsPgsqlOnEcs
權限詳情
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateNetworkInterface",
"ecs:DeleteNetworkInterface",
"ecs:AttachNetworkInterface",
"ecs:DetachNetworkInterface",
"ecs:DescribeNetworkInterfaces",
"ecs:CreateNetworkInterfacePermission",
"ecs:DescribeNetworkInterfacePermissions",
"ecs:CreateSecurityGroup",
"ecs:DeleteSecurityGroup",
"ecs:DescribeSecurityGroupAttribute",
"ecs:DescribeSecurityGroups",
"ecs:ModifySecurityGroupAttribute",
"ecs:AuthorizeSecurityGroup",
"ecs:AuthorizeSecurityGroupEgress",
"ecs:RevokeSecurityGroup",
"ecs:RevokeSecurityGroupEgress"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"kms:Listkeys",
"kms:Listaliases",
"kms:ListResourceTags",
"kms:DescribeKey",
"kms:UntagResource",
"kms:TagResource",
"kms:DescribeAccountKmsStatus"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:GenerateDataKey"
],
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEqualsIgnoreCase": {
"kms:tag/acs:rds:instance-encryption": "true"
}
}
},
{
"Action": [
"vpc:DescribeVSwitches",
"vpc:DescribeVpcs"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": "ram:DeleteServiceLinkedRole",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
"ram:ServiceName": "pgsql-onecs.rds.aliyuncs.com"
}
}
}
]
}
創建角色
登錄RAM控制臺。
在左側導航欄選擇身份管理 > 角色。
單擊創建角色。
在創建角色向導的選擇類型步驟中,選擇阿里云服務,然后單擊下一步。
在配置角色步驟中,角色類型選擇服務關聯角色,選擇云服務配置為云關系型數據庫 Postgresql-OnEcs,然后單擊完成。
刪除角色
如果您需要刪除服務關聯角色,需要先釋放依賴這個服務角色的所有實例。
AliyunServiceRoleForRDSProxyOnEcs
角色名稱
AliyunServiceRoleForRDSProxyOnEcs
角色權限策略
AliyunServiceRolePolicyForRDSProxyOnEcs
權限詳情
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateNetworkInterface",
"ecs:DeleteNetworkInterface",
"ecs:AttachNetworkInterface",
"ecs:DetachNetworkInterface",
"ecs:DescribeNetworkInterfaces",
"ecs:CreateNetworkInterfacePermission",
"ecs:DescribeNetworkInterfacePermissions",
"ecs:CreateSecurityGroup",
"ecs:DeleteSecurityGroup",
"ecs:DescribeSecurityGroupAttribute",
"ecs:DescribeSecurityGroups",
"ecs:ModifySecurityGroupAttribute",
"ecs:AuthorizeSecurityGroup",
"ecs:AuthorizeSecurityGroupEgress",
"ecs:RevokeSecurityGroup",
"ecs:RevokeSecurityGroupEgress"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"vpc:DescribeVSwitches",
"vpc:DescribeVpcs"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": "ram:DeleteServiceLinkedRole",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
"ram:ServiceName": "rdsproxy-onecs.rds.aliyuncs.com"
}
}
}
]
}
創建角色
該角色用于RDS PostgreSQL數據庫代理授權,您可以在創建數據庫代理時,根據控制臺提示進行創建,更多信息,請參見開通數據庫代理。
刪除角色
如果您需要刪除服務關聯角色,需要先關閉依賴這個服務角色的所有數據庫代理。
相關OpenAPI
您可以調用CreateServiceLinkedRole接口創建RDS實例的服務關聯角色。需要配置的參數如下:
參數 | 說明 | 示例值 |
RegionId | 地域ID,您可以通過DescribeRegions接口查看可用的地域ID。 | cn-hangzhou |
ServiceLinkedRole | 服務關聯角色。
| AliyunServiceRoleForRdsPgsqlOnEcs |