本文为您介绍计算巢服务关联角色AliyunServiceRoleForComputeNestSupplier、AliyunServiceRoleForComputeNestUser的应用场景以及如何删除服务关联角色。

背景信息

计算巢服务关联角色AliyunServiceRoleForComputeNestSupplier是计算巢服务商侧为了完成某个服务创建时,需要获取其他云服务的访问权限而提供的RAM角色。更多关于服务关联角色的信息请参见 服务关联角色

计算巢服务关联角色AliyunServiceRoleForComputeNestUser是计算巢用户侧为了完成某个服务实例创建时,需要获取其他云服务的访问权限而提供的RAM角色。更多关于服务关联角色的信息请参见 服务关联角色

应用场景

在计算巢控制台服务商侧创建服务或用户侧创建服务实例时,计算巢会自动创建服务关联角色AliyunServiceRoleForComputeNestSupplier或AliyunServiceRoleForComputeNestUser以获取私网连接、云解析、云监控、标签、访问控制等服务的访问权限。

AliyunServiceRoleForComputeNestSupplier

服务商侧创建计算巢服务时,如果角色不存在,计算巢服务会自动创建一个名称为AliyunServiceRoleForComputeNestSupplier的服务关联角色,该角色被授权的权限策略为AliyunServiceRolePolicyForComputeNestSupplier,计算巢服务通过扮演该角色即可成功调用OpenAPI完成服务创建。

权限说明:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "PrivateLink:UpdateVpcEndpointServiceAttribute",
        "PrivateLink:GetVpcEndpointServiceAttribute",
        "PrivateLink:ListVpcEndpointServices",
        "PrivateLink:AddUserToVpcEndpointService",
        "PrivateLink:ListVpcEndpointServiceUsers",
        "PrivateLink:RemoveUserFromVpcEndpointService"
      ],
      "Resource": [
        "*"
      ],
      "Condition": {}
    },
    {
      "Action": "ram:DeleteServiceLinkedRole",
      "Resource": "*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": "supplier.computenest.aliyuncs.com"
        }
      }
    }
  ]
}

AliyunServiceRoleForComputeNestUser

用户侧创建计算巢服务实例时,如果角色不存在,计算巢会自动创建一个名称为AliyunServiceRoleForComputeNestUser的服务关联角色,该角色被授权的权限策略为AliyunServiceRolePolicyForComputeNestUser,计算巢服务通过扮演该角色即可成功调用OpenAPI完成服务实例创建。

权限说明:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "PrivateLink:CreateVpcEndpoint",
        "PrivateLink:UpdateVpcEndpointAttribute",
        "PrivateLink:GetVpcEndpointAttribute",
        "PrivateLink:ListVpcEndpoints",
        "PrivateLink:ListVpcEndpointServicesByEndUser",
        "PrivateLink:DeleteVpcEndpoint",
        "PrivateLink:EnableVpcEndpointConnection",
        "PrivateLink:UpdateVpcEndpointConnectionAttribute",
        "PrivateLink:ListVpcEndpointConnections",
        "PrivateLink:DisableVpcEndpointConnection",
        "PrivateLink:RemoveZoneFromVpcEndpoint",
        "pvtz:DescribeZones",
        "pvtz:AddZone",
        "pvtz:BindZoneVpc",
        "pvtz:AddZoneRecord",
        "pvtz:DeleteZoneRecord",
        "pvtz:DeleteZone",
        "ros:ListStackResources",
        "tag:ListTagResources",
        "cms:CreateDynamicTagGroup",
        "cms:DescribeDynamicTagRuleList",
        "cms:DescribeMonitorGroups",
        "cms:DeleteDynamicTagGroup"
      ],
      "Resource": [
        "*"
      ],
      "Condition": {}
    },
    {
      "Action": [
        "ram:CreateRole",
        "ram:DeleteRole",
        "ram:AttachPolicyToRole",
        "ram:DetachPolicyFromRole",
        
      ],
      "Resource": [
        "acs:ram:*:*:role/aliyuncomputenestsupplierrolefor*",
        "acs:ram:*:system:policy/AliyunComputeNestPolicyForSupplierRole"
      ],
      "Effect": "Allow"
    },
    {
      "Action": "ram:DeleteServiceLinkedRole",
      "Resource": "*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": "user.computenest.aliyuncs.com"
        }
      }
    }
  ]
}

删除服务关联角色

如果您需要删除服务关联角色AliyunServiceRoleForComputeNestSupplier,需要删除服务商账号下的所有服务。而删除AliyunServiceRoleForComputeNestUser时,需先删除用户账号下的所有服务实例。

以下为删除AliyunServiceRoleForComputeNestUser角色的示例:

  1. 登录RAM控制台
  2. 在RAM角色管理页面的搜索框中,输入AliyunServiceRoleForComputeNestUser,自动搜索到名称为AliyunServiceRoleForComputeNestUser的RAM角色。
  3. 在右侧操作列,单击删除
  4. 在删除RAM角色对话框中,单击确定

删除服务关联角色具体操作请参考 服务关联角色

常见问题

1. 为什么我的RAM用户无法自动创建计算巢服务商侧服务关联角色AliyunServiceRoleForComputeNestSupplier?

您需要拥有指定的权限,才能自动创建AliyunServiceRoleForComputeNestSupplier。因此,在RAM用户无法自动创建AliyunServiceRoleForComputeNestSupplier时,您需为其添加以下权限策略。

{
  "Statement": [
    {
      "Action": [
        "ram:CreateServiceLinkedRole"
      ],
      "Resource": "acs:主账号ID:role/*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": [
            "supplier.computenest.aliyuncs.com"
          ]
        }
      }
    }
  ],
  "Version": "1"
}

2. 为什么我的RAM用户无法自动创建计算巢用户侧服务关联角色AliyunServiceRoleForComputeNestUser?

您需要拥有指定的权限,才能自动创建AliyunServiceRoleForComputeNestUser。因此,在RAM用户无法自动创建AliyunServiceRoleForComputeNestUser时,您需为其添加以下权限策略。

{
  "Statement": [
    {
      "Action": [
        "ram:CreateServiceLinkedRole"
      ],
      "Resource": "acs:主账号ID:role/*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": [
            "user.computenest.aliyuncs.com"
          ]
        }
      }
    }
  ],
  "Version": "1"
}