訪問控制(RAM)是阿里云提供的管理用戶身份與資源訪問權(quán)限的服務。使用RAM可以讓您避免與其他用戶共享阿里云賬號密鑰,并可按需為用戶授予最小權(quán)限。RAM中使用權(quán)限策略描述授權(quán)的具體內(nèi)容。
本文為您介紹專有網(wǎng)絡VPC為RAM權(quán)限策略定義的操作(Action)、資源(Resource)和條件(Condition)。專有網(wǎng)絡VPC的RAM代碼(RamCode)為[{"popCode":"Vpc","ramCodes":["vpc"]},{"popCode":"Netana","ramCodes":["vpc"]},{"popCode":"VpcPeer","ramCodes":["vpc"]}],支持的授權(quán)粒度為RESOURCE。
權(quán)限策略通用結(jié)構(gòu)
權(quán)限策略支持JSON格式,其通用結(jié)構(gòu)如下:
{
"Version": "1",
"Statement": [
{
"Effect": "<Effect>",
"Action": "<Action>",
"Resource": "<Resource>",
"Condition": {
"<Condition_operator>": {
"<Condition_key>": [
"<Condition_value>"
]
}
}
}
]
}
- Effect:權(quán)限策略效果。取值:Allow(允許)、Deny(拒絕)。
- Action:授予允許或拒絕權(quán)限的具體操作。具體信息,請參見操作(Action)。
- Resource:受操作影響的具體對象,您可以使用資源ARN來描述指定資源。具體信息,請參見資源(Resource)。
- Condition:指授權(quán)生效的條件。可選字段。具體信息,請參見條件(Condition)。
- Condition_operator:條件運算符,不同類型的條件對應不同的條件運算符。具體信息,請參見權(quán)限策略基本元素。
- Condition_key:條件關鍵字。
- Condition_value:條件關鍵字對應的值。
操作(Action)
下表是專有網(wǎng)絡VPC定義的操作,這些操作可以在RAM權(quán)限策略語句的Action
元素中使用,用來授予執(zhí)行該操作的權(quán)限。下面對表中的具體項提供說明:- 操作:是指具體的權(quán)限點。
- API:是指操作對應的API接口。
- 訪問級別:是指每個操作的訪問級別,取值為寫入(Write)、讀取(Read)或列出(List)。
- 資源類型:是指操作中支持授權(quán)的資源類型。具體說明如下:
- 對于必選的資源類型,用背景高亮的方式表示。
- 對于不支持資源級授權(quán)的操作,用
全部資源
表示。
- 條件關鍵字:是指云產(chǎn)品自身定義的條件關鍵字。該列不體現(xiàn)適用于任何操作的通用條件關鍵字。
- 關聯(lián)操作:是指成功執(zhí)行操作所需要的其他權(quán)限。操作者必須同時具備關聯(lián)操作的權(quán)限,操作才能成功。
操作 | API | 訪問級別 | 資源類型 | 條件關鍵字 | 關聯(lián)操作 |
---|---|---|---|---|---|
vpc:ModifySnatEntry | ModifySnatEntry | update | SnatTable acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId} | 無 | 無 |
vpc:VpcDescribeVpcNatGatewayNetworkInterfaceQuota | VpcDescribeVpcNatGatewayNetworkInterfaceQuota | get | 全部資源 * | 無 | 無 |
vpc:DeleteForwardEntry | DeleteForwardEntry | delete | ForwardTable acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId} | 無 | 無 |
vpc:ListFullNatEntries | ListFullNatEntries | get | FullNat acs:vpc:{#regionId}:{#accountId}:vpcfullnattable/{#FullNatTableId} | 無 | 無 |
vpc:DisableNatGatewayEcsMetric | DisableNatGatewayEcsMetric | delete | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:CreateNatGateway | CreateNatGateway | create | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/* | 無 | 無 |
vpc:DescribeNatGateways | DescribeNatGateways | get | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/*NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:ModifyNatGatewayAttribute | ModifyNatGatewayAttribute | update | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:ModifyNatIpAttribute | ModifyNatIpAttribute | update | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:DeleteSnatEntry | DeleteSnatEntry | delete | SnatTable acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId} | 無 | 無 |
vpc:CreateSnatEntry | CreateSnatEntry | create | SnatEntry acs:vpc:{#regionId}:{#accountId}:snattable/* | 無 | 無 |
vpc:EnableNatGatewayEcsMetric | EnableNatGatewayEcsMetric | create | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:ModifyForwardEntry | ModifyForwardEntry | update | ForwardTable acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId} | 無 | 無 |
vpc:ModifyNatGatewaySpec | ModifyNatGatewaySpec | Write | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:DescribeSnatTableEntries | DescribeSnatTableEntries | get | SnatTable acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId} | 無 | 無 |
vpc:GetNatGatewayAttribute | GetNatGatewayAttribute | get | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:ListEnhanhcedNatGatewayAvailableZones | ListEnhanhcedNatGatewayAvailableZones | list | 全部資源 * | 無 | 無 |
vpc:DescribeForwardTableEntries | DescribeForwardTableEntries | get | ForwardTable acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId} | 無 | 無 |
vpc:DeleteNatGateway | DeleteNatGateway | delete | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#natgatewayid} | 無 | 無 |
vpc:DescribeNatGatewayAssociateNetworkInterfaces | DescribeNatGatewayAssociateNetworkInterfaces | list | NatGateway acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} | 無 | 無 |
vpc:CreateForwardEntry | CreateForwardEntry | create | ForwardTable acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId} | 無 | 無 |
資源(Resource)
下表是專有網(wǎng)絡VPC定義的資源,這些資源可以在RAM權(quán)限策略語句的Resource
元素中使用,用來授予對該資源執(zhí)行具體操作的權(quán)限。 其中,資源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} |
GlobalAccelerationInstance | acs:vpc:{#regionId}:{#accountId}:globalaccelerationinstance/{#GlobalAccelerationInstanceId} |
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/* |
VpnGateway | acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId} |
Instance | acs:ecs:{#regionId}:{#accountId}:instance/* |
GatewayEndpoint | acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/{#GatewayEndpointId} |
HaVip | acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId} |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:bandwidthpackage/{#BandwidthPackageId} |
PhysicalConnection | acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId} |
VpnConnection | acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId} |
GatewayEndpoint | acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/* |
Ipv6InternetBandwidth | acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/{#Ipv6InternetBandwidthId} |
RouterInterface | acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} |
SnatTable | acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId} |
Ipv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/* |
IpsecServer | acs:vpc:{#regionId}:{#accountId}:vpnipsecserver/{#IpsecServerId} |
RouteTable | acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId} |
ForwardTable | acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/* |
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} |
FullNat | acs:vpc:{#regionId}:{#accountId}:vpcfullnattable/{#FullNatTableId} |
VSwitch | acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId} |
SslVpnServer | acs:vpc:{#regionId}:{#accountId}:sslvpnserver/* |
VirtualBorderRouter | acs:expressconnect:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId} |
Ipv4Gateway | acs:vpc:{#regionId}:{#accountId}:ipv4gateway/* |
PrefixList | acs:vpc:{#regionId}:{#accountId}:prefixlist/* |
Ipv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/{#Ipv6TranslatorId} |
VPC | acs:vpc:{#regionId}:{#accountId}:vpc/* |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId} |
TrafficQos | acs:vpc:{#regionId}:{#accountId}:TrafficQos/* |
SslVpnClientCert | acs:vpc:{#regionId}:{#accountId}:sslvpnclientcert/* |
SslVpnClientCert | acs:vpc:{#regionId}:{#accountId}:sslvpnclientcert/{#SslVpnClientCertId} |
FlowLog | acs:vpc:{#regionId}:{#accountId}:flowlog/* |
NetworkAcl | acs:vpc:{#regionId}:{#accountId}:networkacl/* |
NetworkAcl | acs:vpc:{#regionId}:{#accountId}:networkacl/{#NetworkAclId} |
VpnConnections | acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId} |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:bandwidthpackage/* |
Address | acs:vpc:{#regionId}:{#accountId}:eip/* |
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/* |
VpnConnection | acs:vpc:{#regionId}:{#accountId}:vpnconnection/* |
GatewayInfo | acs:vpc:{#regionId}:{#accountId}:eip/* |
RouteTable | acs:vpc:{#regionId}:{#accountId}:routetable/* |
DhcpOptionsSet | acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/* |
RouteTable | acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTable} |
VRouter | acs:vpc:{#regionId}:{#accountId}:vrouter/* |
GlobalAccelerationInstance | acs:vpc:{#regionId}:{#accountId}:globalaccelerationinstance/* |
RouterInterface | acs:expressconnect:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId} |
PublicIpAddressPoolService | acs:vpc:{#regionId}:{#accountId}:publicipaddresspoolservice/* |
TrafficMirrorFilter | acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/* |
PhysicalConnection | acs:vpc:*:{#accountId}:physicalconnection/{#PhysicalConnectionId} |
VirtualBorderRouter | acs:vpc:*:{#AccountId}:virtualborderrouter/{#VbrId} |
RouterInterface | acs:vpc:*:{#AccountId}:routerinterface/{#RouterInterfaceId} |
SslVpnServer | acs:vpc:{#regionId}:{#accountId}:sslvpnserver/{#SslVpnServerId} |
VPC | acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId} |
VpnGateway | acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnInstanceId} |
NatGateway | acs:vpc:{#regionId}:{#accountId}:natgateway/* |
VpnConnection | acs:vpc:{#regionId}:{#accountId}:* |
IPv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/* |
IPv6Translator | acs:vpc:{#regionId}:{#accountId}:ipv6trans/{#IPv6TranslatorId} |
NatIpCidr | acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} |
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} |
HaVip | acs:vpc:{#regionId}:{#accountId}:havip/* |
FlowLogService | acs:vpc:{#regionId}:{#accountId}:flowlog/* |
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/* |
SnatEntry | acs:vpc:{#regionId}:{#accountId}:snattable/* |
Ipv6Gateway | acs:vpc:{#regionId}:{#accountId}:ipv6gateway/* |
TrafficMirrorSession | acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/* |
CommonBandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/* |
VRouter | acs:vpc:{#regionId}:{#accountId}:vrouter/{#VRouterId} |
Instance | acs:ecs:{#regionId}:{#accountId}:instance/{#BackendServerId} |
VirtualBorderRouter | acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#InstanceId} |
GrantRuleToCen | acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId} |
Ipv6Address | acs:vpc:{#regionId}:{#accountId}:ipv6address/{#Ipv6AddressId} |
RouteEntry | acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId} |
TrafficMirrorService | acs:vpc:{#regionId}:{#accountId}:trafficmirror/* |
BandwidthPackage | acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/* |
Ipv6Address | acs:vpc:{#regionId}:{#accountId}:ipv6address/* |
PublicIpAddressPool | acs:vpc:{#regionId}:{#accountId}:publicipaddresspool/* |
RouterInterface | acs:vpc:{#regionId}:{#accountId}:routerinterface/* |
NatIp | acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId} |
SegmentAddress | acs:vpc:{#regionId}:{#accountId}:eip/* |
SegmentAddress | acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId} |
Ipv6InternetBandwidth | acs:vpc:{#regionId}:{#accountId}:vpc/* |
Eip | acs:vpc:{#regionId}:{#accountId}:eip/{#EipId} |
條件(Condition)
下表是專有網(wǎng)絡VPC定義的產(chǎn)品級條件關鍵字,這些條件關鍵字可以在RAM權(quán)限策略語句的
Condition
元素中使用,用來描述授予權(quán)限的條件。以下僅列舉產(chǎn)品級的條件關鍵字,阿里云定義的通用條件關鍵字也同樣適用專有網(wǎng)絡VPC。其中,數(shù)據(jù)類型決定了您可以使用哪些條件運算符將請求中的值與權(quán)限策略語句中的值進行比較。您必須使用與數(shù)據(jù)類型匹配的條件運算符,否則無法匹配策略語句,授權(quán)行為無效。數(shù)據(jù)類型與條件運算符的對應關系,請參見條件操作類型。
條件關鍵字 | 描述 | 類型 |
---|---|---|
vpc:PhysicalConnection | 物理專線信息 | String |
vpc:VBR | 邊界路由器信息 | String |
vpc:VPC | VPC信息 | String |
vpc:VRouter | 路由器信息 | String |
vpc:tag | VPC的標簽 | String |
vpc:TargetAccountRDId | 對端用戶資源目錄ID信息 | String |