訪問控制(RAM)是阿里云提供的管理用戶身份與資源訪問權限的服務。使用RAM可以讓您避免與其他用戶共享阿里云賬號密鑰,并可按需為用戶授予最小權限。RAM中使用權限策略描述授權的具體內容。
本文為您介紹專有網絡VPC為RAM權限策略定義的操作(Action)、資源(Resource)和條件(Condition)。專有網絡VPC的RAM代碼(RamCode)為[{"popCode":"Vpc","ramCodes":["vpc"]},{"popCode":"Netana","ramCodes":["vpc"]},{"popCode":"VpcPeer","ramCodes":["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定義的操作,這些操作可以在RAM權限策略語句的Action
元素中使用,用來授予執行該操作的權限。下面對表中的具體項提供說明:- 操作:是指具體的權限點。
- API:是指操作對應的API接口。
- 訪問級別:是指每個操作的訪問級別,取值為寫入(Write)、讀取(Read)或列出(List)。
- 資源類型:是指操作中支持授權的資源類型。具體說明如下:
- 對于必選的資源類型,用背景高亮的方式表示。
- 對于不支持資源級授權的操作,用
全部資源
表示。
- 條件關鍵字:是指云產品自身定義的條件關鍵字。該列不體現適用于任何操作的通用條件關鍵字。
- 關聯操作:是指成功執行操作所需要的其他權限。操作者必須同時具備關聯操作的權限,操作才能成功。
操作 | API | 訪問級別 | 資源類型 | 條件關鍵字 | 關聯操作 |
---|---|---|---|---|---|
vpc:MoveResourceGroup | MoveResourceGroup | update | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:bandwidthpackage/{#BandwidthPackageId}Eip acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId}VPC acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}PrefixList acs:vpc:{#regionId}:{#accountId}:prefixlist/{#PrefixListId}GatewayEndpoint acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/{#GatewayEndpointId}DhcpOptionsSet acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId}FlowLog acs:vpc:{#regionId}:{#accountId}:flowlog/{#FlowLogId}HaVip acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId}Ipv4Gateway acs:vpc:{#regionId}:{#accountId}:ipv4gateway/{#Ipv4GatewayId}Ipv6Gateway acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}PublicIpAddressPool acs:vpc:{#regionId}:{#accountId}:publicipaddresspool/{#PublicIpAddressPoolId}TrafficMirrorFilter acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId}TrafficMirrorSession acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/{#TrafficMirrorSessionId} | 無 | 無 |
vpc:ModifyCommonBandwidthPackageIpBandwidth | ModifyCommonBandwidthPackageIpBandwidth | update | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:CancelCommonBandwidthPackageIpBandwidth | CancelCommonBandwidthPackageIpBandwidth | update | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:AddCommonBandwidthPackageIps | AddCommonBandwidthPackageIps | create | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:Describe95Traffic | Describe95Traffic | get | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:DeleteCommonBandwidthPackage | DeleteCommonBandwidthPackage | delete | CommonBandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#CommonBandwidthPackageId} | vpc:tag | 無 |
vpc:ModifyCommonBandwidthPackageAttribute | ModifyCommonBandwidthPackageAttribute | update | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:RemoveCommonBandwidthPackageIp | RemoveCommonBandwidthPackageIp | delete | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:CreateCommonBandwidthPackage | CreateCommonBandwidthPackage | create | CommonBandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/* | 無 | 無 |
vpc:ModifyCommonBandwidthPackageSpec | ModifyCommonBandwidthPackageSpec | update | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:AddCommonBandwidthPackageIp | AddCommonBandwidthPackageIp | create | BandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} | 無 | 無 |
vpc:DescribeCommonBandwidthPackages | DescribeCommonBandwidthPackages | get | CommonBandwidthPackage acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/* | 無 | 無 |
資源(Resource)
下表是專有網絡VPC定義的資源,這些資源可以在RAM權限策略語句的Resource
元素中使用,用來授予對該資源執行具體操作的權限。 其中,資源ARN是資源在阿里云上的唯一標識。具體說明如下:{#}
為變量標識,需要您替換為實際值。例如:{#ramcode}
需要您替換為實際的云服務RAM代碼。-
*
表示全部。例如:{#resourceType}
為*
時:表示全部資源。{#regionId}
為*
時:表示全部地域。{#accountId}
為*
時:表示全部阿里云賬號。
資源類型 | 資源ARN |
---|---|
Address | acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId} |
NatGateway | acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} |
Instance | acs:vpc:{#regionId}:{#accountId}:instance/{#InstanceId} |
Association | acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId} |
CustomerGateway | acs:vpc:{#regionId}:{#accountId}:customergateway/{#CustomerGatewayId} |
VpnGateway | acs:vpc:{#regionId}:{#accountId}:vpngateway/* |
VpnAttachment | acs:vpc:{#Region}:{#AccountId}:vpnattachment/{#VpnConnectionId} |
GlobalAccelerationInstance | acs:vpc:{#regionId}:{#accountId}:globalaccelerationinstance/{#GlobalAccelerationInstanceId} |
VpnGateway | acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId} |
GlobalAccelerationInstance | acs:vpc:{#regionId}:{#accountId}:GlobalAccelerationInstance/* |
PhysicalConnection | acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} |
GatewayEndpoint | acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/{#GatewayEndpointId} |
Instance | acs:ecs:{#regionId}:{#accountId}:instance/* |
GatewayEndpoint | acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/* |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:bandwidthpackage/{#BandwidthPackageId} |
HaVip | acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId} |
Ipv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/* |
VpnConnection | acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId} |
RouteTable | acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} |
Ipv6InternetBandwidth | acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/{#Ipv6InternetBandwidthId} |
RouterInterface | acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} |
ForwardTable | acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId} |
FullNat | acs:vpc:{#regionId}:{#accountId}:vpcfullnattable/{#FullNatTableId} |
SnatTable | acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId} |
Eip | acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId} |
VPC | acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId} |
PrefixList | acs:vpc:{#regionId}:{#accountId}:prefixlist/{#PrefixListId} |
DhcpOptionsSet | acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId} |
FlowLog | acs:vpc:{#regionId}:{#accountId}:flowlog/{#FlowLogId} |
Ipv4Gateway | acs:vpc:{#regionId}:{#accountId}:ipv4gateway/{#Ipv4GatewayId} |
Ipv6Gateway | acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId} |
PublicIpAddressPool | acs:vpc:{#regionId}:{#accountId}:publicipaddresspool/{#PublicIpAddressPoolId} |
TrafficMirrorFilter | acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId} |
TrafficMirrorSession | acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/{#TrafficMirrorSessionId} |
IpsecServer | acs:vpc:{#regionId}:{#accountId}:vpnipsecserver/{#IpsecServerId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} |
PrefixList | acs:vpc:{#regionId}:{#accountId}:prefixlist/* |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} |
TrafficQos | acs:vpc:{#regionId}:{#accountId}:TrafficQos/* |
VPC | acs:vpc:{#regionId}:{#accountId}:vpc/* |
SslVpnServer | acs:vpc:{#regionId}:{#accountId}:sslvpnserver/* |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* |
Ipv4Gateway | acs:vpc:{#regionId}:{#accountId}:ipv4gateway/* |
NetworkAcl | acs:vpc:{#regionId}:{#accountId}:networkacl/{#NetworkAclId} |
Ipv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/{#Ipv6TranslatorId} |
VSwitch | acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId} |
VirtualBorderRouter | acs:expressconnect:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId} |
SslVpnClientCert | acs:vpc:{#regionId}:{#accountId}:sslvpnclientcert/* |
SslVpnClientCert | acs:vpc:{#regionId}:{#accountId}:sslvpnclientcert/{#SslVpnClientCertId} |
VpnConnections | acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId} |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:bandwidthpackage/* |
Address | acs:vpc:{#regionId}:{#accountId}:eip/* |
FlowLog | acs:vpc:{#regionId}:{#accountId}:flowlog/* |
NetworkAcl | acs:vpc:{#regionId}:{#accountId}:networkacl/* |
Ipv6InternetBandwidth | acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/* |
VSwitchCidrReservation | acs:vpc:{#regionId}:{#accountId}:vswitchcidrreservation/{#VSwitchCidrReservationId} |
VirtualBorderRouter | acs:vpc:*:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} |
CustomerGateway | acs:vpc:{#regionId}:{#accountId}:customergateway/* |
PhysicalConnection | acs:vpc:{#regionId}:{#accountId}:physicalconnection/* |
CommonBandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#CommonBandwidthPackageId} |
VSwitch | acs:vpc:{#regionId}:{#accountId}:vswitch/* |
RouteTable | acs:vpc:{#regionId}:{#accountId}:routetable/* |
GatewayInfo | acs:vpc:{#regionId}:{#accountId}:eip/* |
DhcpOptionsSet | acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/* |
PhysicalConnection | acs:vpc:*:{#accountId}:physicalconnection/{#PhysicalConnectionId} |
VirtualBorderRouter | acs:vpc:*:{#AccountId}:virtualborderrouter/{#VbrId} |
RouterInterface | acs:vpc:*:{#AccountId}:routerinterface/{#RouterInterfaceId} |
RouteTable | acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTable} |
VRouter | acs:vpc:{#regionId}:{#accountId}:vrouter/* |
PublicIpAddressPoolService | acs:vpc:{#regionId}:{#accountId}:publicipaddresspoolservice/* |
VpnConnection | acs:vpc:{#regionId}:{#accountId}:* |
RouterInterface | acs:expressconnect:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} |
VpnConnection | acs:vpc:{#regionId}:{#accountId}:vpnconnection/* |
TrafficMirrorFilter | acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/* |
VpnGateway | acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnInstanceId} |
IPv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/* |
IPv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/{#IPv6TranslatorId} |
SslVpnServer | acs:vpc:{#regionId}:{#accountId}:sslvpnserver/{#SslVpnServerId} |
GlobalAccelerationInstance | acs:vpc:{#regionId}:{#accountId}:globalaccelerationinstance/* |
NatIpCidr | acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} |
NatGateway | acs:vpc:{#regionId}:{#accountId}:natgateway/* |
VPC | acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId} |
IpsecServer | acs:vpc:{#Region}:{#AccountId}: vpnipsecserver/{#IpsecServerId} |
VpnGateway | acs:vpc:{#regionId}:{#accountId}: |
VpnGateway | acs:vpc:{#Region}:{#AccountId}:vpngateway/{#VpnInstanceId} |
physicalconnection | acs:vpc:{#regionId}:{#accountId}:physicalconnection/* |
IpsecServer | acs:vpc:{#regionId}:{#accountId}:ipsecserver/* |
Ipv6EgressRule | acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId} |
TrafficMirrorSession | acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/* |
HaVip | acs:vpc:{#regionId}:{#accountId}:havip/* |
Instance | acs:ecs:{#regionId}:{#accountId}:instance/{#Instanceid} |
CustomerGateway | acs:vpc:{#Region}:{#AccountId}:customergateway/{#CustomerGatewayId} |
VpnConnection | acs:vpc:{#Region}:{#AccountId}:vpnconnection/{#VpnConnectionId} |
SslVpnServer | acs:vpc:{#Region}:{#AccountId}:sslvpnserver/{#SslVpnServerId} |
VSwitchCidrReservation | acs:vpc:{#regionId}:{#accountId}:vswitchcidrreservation/* |
FlowLogService | acs:vpc:{#regionId}:{#accountId}:flowlog/* |
SnatEntry | acs:vpc:{#regionId}:{#accountId}:snattable/* |
Ipv6Gateway | acs:vpc:{#regionId}:{#accountId}:ipv6gateway/* |
CommonBandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/* |
Instance | acs:ecs:{#regionId}:{#accountId}:instance/{#BackendServerId} |
VRouter | acs:vpc:{#regionId}:{#accountId}:vrouter/{#VRouterId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#InstanceId} |
GrantRuleToCen | acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId} |
Ipv6Address | acs:vpc:{#regionId}:{#accountId}:ipv6address/{#Ipv6AddressId} |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/* |
RouteEntry | acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} |
TrafficMirrorService | acs:vpc:{#regionId}:{#accountId}:trafficmirror/* |
PublicIpAddressPool | acs:vpc:{#regionId}:{#accountId}:publicipaddresspool/* |
Ipv6Address | acs:vpc:{#regionId}:{#accountId}:ipv6address/* |
RouterInterface | acs:vpc:{#regionId}:{#accountId}:routerinterface/* |
NatIp | acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} |
SegmentAddress | acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId} |
SegmentAddress | acs:vpc:{#regionId}:{#accountId}:eip/* |
Eip | acs:vpc:{#regionId}:{#accountId}:eip/{#EipId} |
Ipv6InternetBandwidth | acs:vpc:{#regionId}:{#accountId}:vpc/* |
條件(Condition)
下表是專有網絡VPC定義的產品級條件關鍵字,這些條件關鍵字可以在RAM權限策略語句的
Condition
元素中使用,用來描述授予權限的條件。以下僅列舉產品級的條件關鍵字,阿里云定義的通用條件關鍵字也同樣適用專有網絡VPC。其中,數據類型決定了您可以使用哪些條件運算符將請求中的值與權限策略語句中的值進行比較。您必須使用與數據類型匹配的條件運算符,否則無法匹配策略語句,授權行為無效。數據類型與條件運算符的對應關系,請參見條件操作類型。
條件關鍵字 | 描述 | 類型 |
---|---|---|
vpc:PhysicalConnection | 物理專線信息 | String |
vpc:VBR | 邊界路由器信息 | String |
vpc:VPC | VPC信息 | String |
vpc:VRouter | 路由器信息 | String |
vpc:tag | VPC的標簽 | String |
vpc:TargetAccountRDId | 對端用戶資源目錄ID信息 | String |