訪問控制(RAM)是阿里云提供的管理用戶身份與資源訪問權限的服務。使用RAM可以讓您避免與其他用戶共享阿里云賬號密鑰,并可按需為用戶授予最小權限。RAM中使用權限策略描述授權的具體內容。
本文為您介紹專有網絡VPC(VPC)為RAM權限策略定義的操作(Action)、資源(Resource)和條件(Condition)。專有網絡VPC(VPC)的RAM代碼(RamCode)為vpc,支持的授權粒度為RESOURCE。
權限策略通用結構
權限策略支持JSON格式,其通用結構如下:
{
"Version": "1",
"Statement": [
{
"Effect": "<Effect>",
"Action": "<Action>",
"Resource": "<Resource>",
"Condition": {
"<Condition_operator>": {
"<Condition_key>": [
"<Condition_value>"
]
}
}
}
]
}
- Effect:權限策略效果。取值:Allow(允許)、Deny(拒絕)。
- Action:授予允許或拒絕權限的具體操作。具體信息,請參見操作(Action)。
- Resource:受操作影響的具體對象,您可以使用資源ARN來描述指定資源。具體信息,請參見資源(Resource)。
- Condition:指授權生效的條件。可選字段。具體信息,請參見條件(Condition)。
- Condition_operator:條件運算符,不同類型的條件對應不同的條件運算符。具體信息,請參見權限策略基本元素。
- Condition_key:條件關鍵字。
- Condition_value:條件關鍵字對應的值。
操作(Action)
下表是專有網絡VPC(VPC)定義的操作,這些操作可以在RAM權限策略語句的Action
元素中使用,用來授予執行該操作的權限。下面對表中的具體項提供說明:- 操作:是指具體的權限點。
- API:是指操作對應的API接口。
- 訪問級別:是指每個操作的訪問級別,取值為寫入(Write)、讀取(Read)或列出(List)。
- 資源類型:是指操作中支持授權的資源類型。具體說明如下:
- 對于必選的資源類型,用背景高亮的方式表示。
- 對于不支持資源級授權的操作,用
全部資源
表示。
- 條件關鍵字:是指云產品自身定義的條件關鍵字。該列不體現適用于任何操作的通用條件關鍵字。
- 關聯操作:是指成功執行操作所需要的其他權限。操作者必須同時具備關聯操作的權限,操作才能成功。
操作 | API | 訪問級別 | 資源類型 | 條件關鍵字 | 關聯操作 |
---|---|---|---|---|---|
vpc:ActivateRouterInterface | ActivateRouterInterface | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} | 無 | 無 |
vpc:AddBgpNetwork | AddBgpNetwork | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:ApplyPhysicalConnectionLOA | ApplyPhysicalConnectionLOA | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:AssociatePhysicalConnectionToVirtualBorderRouter | AssociatePhysicalConnectionToVirtualBorderRouter | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId}VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:AttachVbrToVpconn | AttachVbrToVpconn | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#virtualborderrouterId} | 無 | 無 |
vpc:CancelPhysicalConnection | CancelPhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:CompletePhysicalConnectionLOA | CompletePhysicalConnectionLOA | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:ConfirmPhysicalConnection | ConfirmPhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionid}:{#accountid}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:ConnectRouterInterface | ConnectRouterInterface | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} | 無 | 無 |
vpc:CreateBgpGroup | CreateBgpGroup | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:CreateBgpPeer | CreateBgpPeer | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:CreatePhysicalConnection | CreatePhysicalConnection | Write | physicalconnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:CreatePhysicalConnectionOccupancyOrder | CreatePhysicalConnectionOccupancyOrder | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:CreatePhysicalConnectionSetupOrder | CreatePhysicalConnectionSetupOrder | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:CreateRouteEntry | CreateRouteEntry | Write | RouteTable acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} | 無 | 無 |
vpc:CreateRouterInterface | CreateRouterInterface | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/*VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId}VRouter acs:vpc:{#regionId}:{#accountId}:vrouter/{#VRouterId} | vpc:TargetAccountRDId | 無 |
vpc:CreateVbrHa | CreateVbrHa | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:CreateVirtualBorderRouter | CreateVirtualBorderRouter | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId}VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:CreateVirtualPhysicalConnection | CreateVirtualPhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#physicalconnectionId} | 無 | 無 |
vpc:CreateVpconnFromVbr | CreateVpconnFromVbr | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#virtualborderrouterId} | 無 | 無 |
vpc:DeactivateRouterInterface | DeactivateRouterInterface | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} | 無 | 無 |
vpc:DeleteBgpGroup | DeleteBgpGroup | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:DeleteBgpNetwork | DeleteBgpNetwork | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:DeleteBgpPeer | DeleteBgpPeer | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:DeletePhysicalConnection | DeletePhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:DeleteRouteEntry | DeleteRouteEntry | Write | RouteTable acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} | 無 | 無 |
vpc:DeleteRouterInterface | DeleteRouterInterface | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} | 無 | 無 |
vpc:DeleteVbrHa | DeleteVbrHa | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:DeleteVirtualBorderRouter | DeleteVirtualBorderRouter | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:DescribeBgpGroups | DescribeBgpGroups | Read | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:DescribeBgpNetworks | DescribeBgpNetworks | Read | virtualborderrouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/*VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:DescribeBgpPeers | DescribeBgpPeers | Read | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:DescribePhysicalConnectionLOA | DescribePhysicalConnectionLOA | List | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:DescribePhysicalConnections | DescribePhysicalConnections | List | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:DescribeRouteEntryList | DescribeRouteEntryList | List | RouteTable acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} | 無 | 無 |
vpc:DescribeRouterInterfaceAttribute | DescribeRouterInterfaceAttribute | Read | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/* | 無 | 無 |
vpc:DescribeRouterInterfaces | DescribeRouterInterfaces | List | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/* | 無 | 無 |
vpc:DescribeVbrHa | DescribeVbrHa | Read | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:DescribeVirtualBorderRouters | DescribeVirtualBorderRouters | List | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | 無 | 無 |
vpc:DescribeVirtualBorderRoutersForPhysicalConnection | DescribeVirtualBorderRoutersForPhysicalConnection | List | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* | vpc:PhysicalConnection | 無 |
vpc:EnablePhysicalConnection | EnablePhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:GetPhysicalConnectionServiceStatus | GetPhysicalConnectionServiceStatus | Read | acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:ListVirtualPhysicalConnections | ListVirtualPhysicalConnections | List | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/* | 無 | 無 |
vpc:ModifyBgpGroupAttribute | ModifyBgpGroupAttribute | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:ModifyBgpPeerAttribute | ModifyBgpPeerAttribute | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:ModifyPhysicalConnectionAttribute | ModifyPhysicalConnectionAttribute | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:ModifyRouteEntry | ModifyRouteEntry | Write | RouteTable acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} | 無 | 無 |
vpc:ModifyRouterInterfaceAttribute | ModifyRouterInterfaceAttribute | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} | vpc:TargetAccountRDId | 無 |
vpc:ModifyRouterInterfaceSpec | ModifyRouterInterfaceSpec | Write | RouterInterface acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} | 無 | 無 |
vpc:ModifyVirtualBorderRouterAttribute | ModifyVirtualBorderRouterAttribute | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:OpenPhysicalConnectionService | OpenPhysicalConnectionService | Read | 全部資源 acs:vpc:*:{#accountId}:* | 無 | 無 |
vpc:RecoverPhysicalConnection | RecoverPhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#physicalconnectionId} | 無 | 無 |
vpc:RecoverVirtualBorderRouter | RecoverVirtualBorderRouter | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:TerminatePhysicalConnection | TerminatePhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} | 無 | 無 |
vpc:TerminateVirtualBorderRouter | TerminateVirtualBorderRouter | Write | VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:UnassociatePhysicalConnectionFromVirtualBorderRouter | UnassociatePhysicalConnectionFromVirtualBorderRouter | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId}VirtualBorderRouter acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:UpdateVirtualBorderBandwidth | UpdateVirtualBorderBandwidth | Write | VirtualBorderRouter acs:vpc:*:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} | 無 | 無 |
vpc:UpdateVirtualPhysicalConnection | UpdateVirtualPhysicalConnection | Write | PhysicalConnection acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#physicalconnectionId} | 無 | 無 |
資源(Resource)
下表是專有網絡VPC(VPC)定義的資源,這些資源可以在RAM權限策略語句的Resource
元素中使用,用來授予對該資源執行具體操作的權限。 其中,資源ARN是資源在阿里云上的唯一標識。具體說明如下:{#}
為變量標識,需要您替換為實際值。例如:{#ramcode}
需要您替換為實際的云服務RAM代碼。-
*
表示全部。例如:{#resourceType}
為*
時:表示全部資源。{#regionId}
為*
時:表示全部地域。{#accountId}
為*
時:表示全部阿里云賬號。
資源類型 | 資源ARN |
---|---|
VPC | acs:{#ramcode}:{#regionId}:{#accountId}:vpc/{#VpcId} |
PrefixList | acs:{#ramcode}:{#regionId}:{#accountId}:prefixlist/{#PrefixListId} |
RouteTable | acs:{#ramcode}:{#regionId}:{#accountId}:routetable/{#RouteTableId} |
DhcpOptionsSet | acs:{#ramcode}:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId} |
TrafficMirrorFilter | acs:{#ramcode}:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId} |
FlowLogService | acs:{#ramcode}:{#regionId}:{#accountId}:flowlogservice/{#FlowLogServiceId} |
TrafficMirrorSession | acs:{#ramcode}:{#regionId}:{#accountId}:trafficmirrorsession/{#TrafficMirrorSessionId} |
Ipv6Gateway | acs:{#ramcode}:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId} |
VSwitch | acs:{#ramcode}:{#regionId}:{#accountId}:vswitch/{#VSwitchId} |
NetworkAcl | acs:{#ramcode}:{#regionId}:{#accountId}:networkacl/{#NetworkAclId} |
GlobalAccelerationInstance | acs:{#ramcode}:{#regionId}:{#accountId}:globalaccelerationinstance/{#GlobalAccelerationInstanceId} |
Ipv6EgressRule | acs:{#ramcode}:{#regionId}:{#accountId}:ipv6egressrule/{#Ipv6GatewayId}/{#Ipv6EgressRuleId} |
PublicIpAddressPool | acs:{#ramcode}:{#regionId}:{#accountId}:publicipaddresspool/{#PublicIpAddressPoolId} |
GatewayEndpoint | acs:{#ramcode}:{#regionId}:{#accountId}:gatewayendpoint/{#GatewayEndpointId} |
VRouter | acs:{#ramcode}:{#regionId}:{#accountId}:vrouter/{#VRouterId} |
Ipv6InternetBandwidth | acs:{#ramcode}:{#regionId}:{#accountId}:ipv6internetbandwidth/{#Ipv6InternetBandwidthId} |
Ipv4Gateway | acs:{#ramcode}:{#regionId}:{#accountId}:ipv4gateway/{#Ipv4GatewayId} |
HaVip | acs:{#ramcode}:{#regionId}:{#accountId}:havip/{#HaVipId} |
TrafficMirrorService | acs:{#ramcode}:*:{#accountId}:trafficmirrorservice |
FlowLog | acs:{#ramcode}:{#regionId}:{#accountId}:flowlog/{#FlowLogId} |
RouteEntry | acs:{#ramcode}:{#regionId}:{#accountId}:routeentry/{#RouteEntryId} |
GrantRuleToCen | acs:{#ramcode}:{#regionId}:{#accountId}:grantruletocen/{#InstanceId}/{#CenId} |
條件(Condition)
下表是專有網絡VPC(VPC)定義的產品級條件關鍵字,這些條件關鍵字可以在RAM權限策略語句的
Condition
元素中使用,用來描述授予權限的條件。以下僅列舉產品級的條件關鍵字,阿里云定義的通用條件關鍵字也同樣適用專有網絡VPC(VPC)。其中,數據類型決定了您可以使用哪些條件運算符將請求中的值與權限策略語句中的值進行比較。您必須使用與數據類型匹配的條件運算符,否則無法匹配策略語句,授權行為無效。數據類型與條件運算符的對應關系,請參見條件操作類型。
條件關鍵字 | 描述 | 類型 |
---|---|---|
vpc:PhysicalConnection | 物理專線信息 | String |
vpc:VBR | 邊界路由器信息 | String |
vpc:VPC | VPC信息 | String |
vpc:VRouter | 路由器信息 | String |
vpc:tag | VPC的標簽 | String |
vpc:TargetAccountRDId | 對端用戶資源目錄ID信息 | String |