访问控制(RAM)是阿里云提供的管理用户身份与资源访问权限的服务。使用RAM可以让您避免与其他用户共享阿里云账号密钥,并可按需为用户授予最小权限。RAM中使用获取最小权限策略描述授权的具体内容。

本文为您介绍私网连接(Privatelink)为RAM权限策略定义的操作(Action)、资源(Resource)和条件(Condition)。私网连接(Privatelink)的RAM代码(RamCode)为 privatelink,支持的授权粒度为资源级

权限策略通用结构

权限策略支持JSON格式,其通用结构如下:展开详情

操作(Action)

下表是私网连接(Privatelink)定义的操作,这些操作可以在RAM权限策略语句的Action元素中使用,用来授予执行该操作的权限。下面对表中的具体项提供说明:展开详情

操作API访问级别资源类型条件关键字关联操作
privatelink:AddUserToVpcEndpointService
为终端节点服务添加服务白名单
Create
VpcEndpointService
acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/{#ServiceId}
privatelink:AddZoneToVpcEndpoint
为终端节点添加可用区
Create
VpcEndpoint
acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/{#EndpointId}
privatelink:AttachResourceToVpcEndpointService
为终端节点服务添加服务资源
Update
VpcEndpointService
acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/{#ServiceId}
LoadBalancer
acs:slb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
LoadBalancer
acs:alb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
LoadBalancer
acs:nlb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
NatGateway
acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
privatelink:AttachSecurityGroupToVpcEndpoint
将终端节点加入安全组
Update
VpcEndpoint
acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/{#EndpointId}
SecurityGroup
acs:ecs:{#regionId}:{#accountId}:securitygroup/{#SecurityGroupId}
privatelink:ChangeResourceGroup
更改资源组
Update
VpcEndpoint
acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/{#EndpointId}
VpcEndpointService
acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/{#ServiceId}
privatelink:CheckProductOpen
查询是否已开通私网连接
None
全部资源
*
privatelink:CreateVpcEndpoint
创建终端节点
Create
VpcEndpoint
acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/*
SecurityGroup
acs:ecs:{#regionId}:{#accountId}:securitygroup/{#SecurityGroupId}
VSwitch
acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
VPC
acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}
privatelink:VpcEndpointServiceId
privatelink:CreateVpcEndpointService
创建终端节点服务
Create
VpcEndpointService
acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/*
LoadBalancer
acs:alb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
LoadBalancer
acs:nlb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
NatGateway
acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
LoadBalancer
acs:slb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
privatelink:DeleteVpcEndpoint
删除终端节点
Delete
VpcEndpoint
acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/{#EndpointId}
privatelink:DeleteVpcEndpointService
删除终端节点服务
Delete
VpcEndpointService
acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/{#ServiceId}
资源(Resource)

下表是私网连接(Privatelink)定义的资源,这些资源可以在RAM权限策略语句的Resource元素中使用,用来授予对该资源执行具体操作的权限。

其中,资源ARN是资源在阿里云上的唯一标识。具体说明如下:

  • {#}为变量标识,需要您替换为实际值。例如: {#ramcode} 需要您替换为实际的云服务RAM代码。
  • *表示全部。例如:
    • {#resourceType}/* :表示全部资源。
    • {#regionId}*时:表示全部地域。
    • {#accountId}*时:表示全部阿里云账号。
资源类型资源ARN
LoadBalancer
  • acs:slb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
  • acs:alb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
  • acs:nlb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}
NatGateway
  • acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
SecurityGroup
  • acs:ecs:{#regionId}:{#accountId}:securitygroup/{#SecurityGroupId}
VPC
  • acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}
VSwitch
  • acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
VpcEndpoint
  • acs:privatelink:*:{#accountId}:vpcendpoint/{#vpcendpointId}
  • acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/{#EndpointId}
  • acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/*
VpcEndpointService
  • acs:privatelink:*:{#accountId}:vpcendpointservice/{#vpcendpointserviceId}
  • acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/{#vpcendpointserviceId}
  • acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/{#ServiceId}
  • acs:privatelink:{#regionId}:{#accountId}:vpcendpointservice/*
条件(Condition)

下表是私网连接(Privatelink)定义的产品级条件关键字,这些条件关键字可以在RAM权限策略语句的Condition元素中使用,用来描述授予权限的条件。以下仅列举产品级的条件关键字,阿里云定义的通用条件关键字也同样适用私网连接(Privatelink)

其中,数据类型决定了您可以使用哪些条件运算符将请求中的值与权限策略语句中的值进行比较。您必须使用与数据类型匹配的条件运算符,否则无法匹配策略语句,授权行为无效。数据类型与条件运算符的对应关系,请参见条件操作类型

条件关键字描述类型
privatelink:VpcEndpointServiceId
vpcendpointservice的id
string
相关操作

您可以创建自定义权限策略,并将权限策略授予RAM用户、RAM用户组或RAM角色。具体操作如下: