RAM authorization

Updated at:

Resource Access Management (RAM) is a service provided by Alibaba Cloud to manage user identities and resource access permissions. Using RAM helps you avoid sharing your Alibaba Cloud account keys with other users and allows you to grant users the least privilege access. RAM uses permission policies to define authorizations. This topic describes the actions, resources, and conditions that Virtual Private Cloud defines for RAM permission policies. The RamCode of Virtual Private Cloud is vpc , and the supported authorization granularity is RESOURCE . For the resource authorization scope of each action, see the Action table.

General structure of a policy

Permission policies support the JSON format. The following example shows the structure of a policy that uses the Action element. Values in angle brackets (<>) are placeholders. Replace them with actual values.

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "<Effect>",
      "Action": "<Action>",
      "Resource": "<Resource>",
      "Condition": {
        "<Condition_operator>": {
          "<Condition_key>": [
            "<Condition_value>"
          ]
        }
      }
    }
  ]
}        

The following list describes the fields and placeholders in the policy:

  • Effect: Specifies the authorization result. Valid values: Allow and Deny.

  • Action: Specifies one or more operations that are allowed or denied.

  • Resource: Specifies the specific objects affected by the operations. You can use Alibaba Cloud Resource Names (ARNs) to describe specific resources.

  • Condition: Specifies the conditions for the authorization to take effect. This field is optional.

  • Condition operator: Specifies the conditional operators. Different types of conditions support different conditional operators.

  • Condition_key: Specifies the condition keys.

  • Condition_value: Specifies the condition values.

Action

The following table lists the RAM actions defined by Virtual Private Cloud. These actions can be used in the Action element of RAM permission policies.

  • Action: A specific RAM permission point. In most cases, it has the same name as the corresponding OpenAPI.

  • OpenAPI: The OpenAPI associated with the RAM action.

  • Access level: Write, Read, List, or Other.

  • Resource type: The types of resources for which the action supports authorization. Details are as follows:

    • Required resource types are prefixed with an asterisk (*). Specify the corresponding ARN in the Resource element of the policy.

    • When 'All Resources' is displayed and the resource ARN is *, set Resource in the policy to *.

  • Condition key: The product-level condition keys supported by the action. Common condition keys are not included. For more information, see Common condition keys.

  • Dependent action: Other action permissions required to perform the action.

Action

OpenAPI

Access level

Resource type

Condition key

Dependent action

vpc:ModifyIpv6InternetBandwidth ModifyIpv6InternetBandwidth update

*Ipv6InternetBandwidth

acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/{#Ipv6InternetBandwidthId}

None None
vpc:ModifyIpv6AddressAttribute ModifyIpv6AddressAttribute update

*VPC

acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}

None None
vpc:AllocateIpv6Address AllocateIpv6Address create

*Ipv6Address

acs:vpc:{#regionId}:{#accountId}:ipv6address/*

None None
vpc:DescribeIpv6GatewayAttribute DescribeIpv6GatewayAttribute get

*Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None
vpc:CreateIpv6Gateway CreateIpv6Gateway create

*Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/*

None None
vpc:DescribeIpv6EgressOnlyRules DescribeIpv6EgressOnlyRules get

*Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None
vpc:DescribeIpv6Gateways DescribeIpv6Gateways get

Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/*

Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None
vpc:DeleteIpv6EgressOnlyRule DeleteIpv6EgressOnlyRule delete

*Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None
vpc:CreateIpv6EgressOnlyRule CreateIpv6EgressOnlyRule create

*Ipv6EgressRule

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None
vpc:ReleaseIpv6Address ReleaseIpv6Address delete

*Ipv6Address

acs:vpc:{#regionId}:{#accountId}:ipv6address/{#Ipv6AddressId}

None None
vpc:AllocateIpv6InternetBandwidth AllocateIpv6InternetBandwidth create

*Ipv6InternetBandwidth

acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/*

None None
vpc:DeleteIpv6Gateway DeleteIpv6Gateway delete

*Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None
vpc:DescribeIpv6Addresses DescribeIpv6Addresses list

*Ipv6InternetBandwidth

acs:vpc:{#regionId}:{#accountId}:vpc/*

None None
vpc:DeleteIpv6InternetBandwidth DeleteIpv6InternetBandwidth delete

*Ipv6InternetBandwidth

acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/{#Ipv6InternetBandwidthId}

None None
vpc:ModifyIpv6GatewayAttribute ModifyIpv6GatewayAttribute update

*Ipv6Gateway

acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}

None None

Resource

The following table lists the resource types and ARN formats defined by Virtual Private Cloud. The Resource element of RAM policy statements specifies the resources to which the statement applies. Notes:

  • In an ARN, {#} indicates a variable that you must replace with an actual value. For example, replace {#ramcode} with the actual RAM code of the cloud service.

  • In an ARN, * means all. For example:

    • {#resourceType}/*: All resources.

    • When {#regionId} is *, all regions are included.

    • When {#accountId} is set to *, it specifies all Alibaba Cloud accounts.

Resource type

ARN

PrefixList
  • acs:vpc:{#regionId}:{#accountId}:prefixlist/{#PrefixListId}
  • acs:vpc:{#regionId}:{#accountId}:prefixlist/*
BandwidthPackage
  • acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#BandwidthPackageId}
  • acs:vpc:{#regionId}:{#accountId}:bandwidthpackage/{#BandwidthPackageId}
HaVip
  • acs:vpc:{#regionId}:{#accountId}:havip/*
  • acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId}
VSwitch
  • acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
  • acs:vpc:{#regionid}:{#accountId}:vswitch/*
SslVpnClientCert
  • acs:vpc:{#regionId}:{#accountId}:sslvpnclientcert/{#SslVpnClientCertId}
  • acs:vpc:{#regionId}:{#accountId}:sslvpnclientcert/*
VirtualBorderRouter
  • acs:vpc:*:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId}
  • acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VirtualBorderRouterId}
  • acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId}
  • acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#InstanceId}
  • acs:vpc:{#regionId}:{#AccountId}:virtualborderrouter/*
Ipv6Translator
  • acs:vpc:{#regionId}:{#accountId}:ipv6trans/{#Ipv6TranslatorId}
  • acs:vpc:{#regionId}:{#accountId}:ipv6trans/*
NatGateway
  • acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
  • acs:vpc:{#regionId}:{#accountId}:natgateway/*
  • acs:natgateway:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
VPC
  • acs:vpc:{#regionId}:{#accountId}:vpc/*
  • acs:vpc:{#regionId}:{#accountId}:vpc/{#VPCId}
  • acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId}
TrafficQos
  • acs:vpc:{#regionId}:{#accountId}:TrafficQos/*
  • acs:vpc:{#regionId}:{#accountId}:trafficqos/{#QosId}
DhcpOptionsSet
  • acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId}
  • acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/*
PhysicalConnection
  • acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId}
  • acs:vpc:{#regionId}:{#accountId}:physicalconnection/*
Ipv6InternetBandwidth
  • acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/{#Ipv6InternetBandwidthId}
  • acs:vpc:{#regionId}:{#accountId}:ipv6bandwidth/*
  • acs:vpc:{#regionId}:{#accountId}:vpc/*
RouteTable
  • acs:vpc:{#regionId}:{#accountId}:routetable/{#routetableId}
  • acs:vpc:{#regionId}:{#accountId}:routetable/*
  • acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTable}
FlowLog
  • acs:vpc:{#regionId}:{#accountId}:flowlog/{#FlowLogId}
  • acs:vpc:{#regionId}:{#accountId}:flowlog/*
Ipv4Gateway
  • acs:vpc:{#regionId}:{#accountId}:ipv4gateway/{#Ipv4GatewayId}
  • acs:vpc:{#regionId}:{#accountId}:ipv4gateway/*
RouteEntry
  • acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}
IPv6Translator
  • acs:vpc:{#regionId}:{#accountId}:ipv6trans/*
  • acs:vpc:{#regionId}:{#accountId}:ipv6trans/{#IPv6TranslatorId}
RouterInterface
  • acs:vpc:{#regionId}:{#accountId}:routerinterface/{#RouterInterfaceId}
  • acs:vpc:{#regionId}:{#accountId}:routerinterface/*
CustomerGateway
  • acs:vpc:{#regionId}:{#accountId}:customergateway/*
  • acs:vpc:{#regionId}:{#accountId}:customergateway/{#CustomerGatewayId}
  • acs:vpc:{#Region}:{#AccountId}:customergateway/{#CustomerGatewayId}
VpnConnections
  • acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId}
VpnGateway
  • acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}
  • acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnInstanceId}
  • acs:vpc:{#regionId}:{#accountId}:vpngateway/*
  • acs:vpc:{#Region}:{#AccountId}:vpngateway/{#VpnInstanceId}
  • acs:vpc:{#regionId}:{#accountId}:
VSwitchCidrReservation
  • acs:vpc:{#regionId}:{#accountId}:vswitchcidrreservation/{#VSwitchCidrReservationId}
  • acs:vpc:{#regionId}:{#accountId}:vswitchcidrreservation/*
TrafficMirrorSession
  • acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/{#TrafficMirrorSessionId}
  • acs:vpc:{#regionId}:{#accountId}:trafficmirrorsession/*
Eip
  • acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId}
  • acs:vpc:{#regionId}:{#accountId}:eip/{#EipId}
GatewayEndpoint
  • acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/{#GatewayEndpointId}
  • acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/*
Ipv6Gateway
  • acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}
  • acs:vpc:{#regionId}:{#accountId}:ipv6gateway/*
PublicIpAddressPool
  • acs:vpc:{#regionId}:{#accountId}:publicipaddresspool/{#PublicIpAddressPoolId}
  • acs:vpc:{#regionId}:{#accountId}:publicipaddresspool/*
TrafficMirrorFilter
  • acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/{#TrafficMirrorFilterId}
  • acs:vpc:{#regionId}:{#accountId}:trafficmirrorfilter/*
RouteTargetGroup
  • acs:vpc:{#regionId}:{#accountId}:routetargetgroup/*
  • acs:vpc:{#regionId}:{#accountId}:routetargetgroup/{#RouteTargetGroupId}
Address
  • acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId}
  • acs:vpc:{#regionId}:{#accountId}:eip/*
VpnConnection
  • acs:vpc:{#regionId}:{#accountId}:vpnconnection/{#VpnConnectionId}
  • acs:vpc:{#regionId}:{#accountId}:vpnconnection/*
  • acs:vpc:{#Region}:{#AccountId}:vpnconnection/{#VpnConnectionId}
  • acs:vpc:{#regionId}:{#accountId}:*
VRouter
  • acs:vpc:{#regionId}:{#accountId}:vrouter/{#VRouterId}
  • acs:vpc:{#regionId}:{#accountId}:vrouter/*
Ipv6Address
  • acs:vpc:{#regionId}:{#accountId}:ipv6address/*
  • acs:vpc:{#regionId}:{#accountId}:ipv6address/{#Ipv6AddressId}
NetworkAcl
  • acs:vpc:{#regionId}:{#accountId}:networkacl/*
  • acs:vpc:{#regionId}:{#accountId}:networkacl/{#NetworkAclId}
SslVpnServer
  • acs:vpc:{#regionId}:{#accountId}:sslvpnserver/{#SslVpnServerId}
  • acs:vpc:{#regionId}:{#accountId}:sslvpnserver/*
  • acs:vpc:{#Region}:{#AccountId}:sslvpnserver/{#SslVpnServerId}
VpnCertificateAttachment
  • acs:vpc:{#regionId}:{#accountId}:vpncertificateattachment/{#VpnGatewayId}/{#CertificateType}/{#CertificateId}
Instance
  • acs:vpc:{#regionId}:{#accountId}:instance/{#InstanceId}
  • acs:ecs:{#regionId}:{#accountId}:instance/*
  • acs:ecs:{#regionId}:{#accountId}:instance/{#InstanceId}
SnatEntry
  • acs:vpc:{#regionId}:{#accountId}:snattable/*
GlobalAccelerationInstance
  • acs:vpc:{#regionId}:{#accountId}:globalaccelerationinstance/{#GlobalAccelerationInstanceId}
  • acs:vpc:{#regionId}:{#accountId}:GlobalAccelerationInstance/*
  • acs:vpc:{#regionId}:{#accountId}:globalaccelerationinstance/*
IpsecServer
  • acs:vpc:{#regionId}:{#accountId}:vpnipsecserver/{#IpsecServerId}
  • acs:vpc:{#Region}:{#AccountId}: vpnipsecserver/{#IpsecServerId}
  • acs:vpc:{#regionId}:{#accountId}: vpnipsecserver/{#IpsecServerId}
  • acs:vpc:{#regionId}:{#accountId}:ipsecserver/*
SnatTable
  • acs:vpc:{#regionId}:{#accountId}:snattable/{#SnatTableId}
GrantRuleToCen
  • acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId}
TrafficMirrorService
  • acs:vpc:{#regionId}:{#accountId}:trafficmirror/*
FullNat
  • acs:vpc:{#regionId}:{#accountId}:vpcfullnattable/{#FullNatTableId}
CommonBandwidthPackage
  • acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/*
  • acs:vpc:{#regionId}:{#accountId}:combandwidthpackage/{#CommonBandwidthPackageId}
SegmentAddress
  • acs:vpc:{#regionId}:{#accountId}:eip/{#AllocationId}
  • acs:vpc:{#regionId}:{#accountId}:eip/*
  • acs:eip:{#regionId}:{#accountId}:eipsegment/{#SegmentInstanceId}
VpnAttachment
  • acs:vpc:{#Region}:{#AccountId}:vpnattachment/{#VpnConnectionId}
ForwardTable
  • acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId}
PublicIpAddressPoolService
  • acs:vpc:{#regionId}:{#accountId}:publicipaddresspoolservice/*
Ipv6EgressRule
  • acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}
FlowLogService
  • acs:vpc:{#regionId}:{#accountId}:flowlog/*
GatewayInfo
  • acs:vpc:{#regionId}:{#accountId}:eip/*
physicalconnection
  • acs:vpc:{#regionId}:{#accountId}:physicalconnection/*
Association
  • acs:vpc:{#regionId}:{#accountId}:havip/{#HaVipId}

Condition

The following table lists the product-level condition keys defined by Virtual Private Cloud. Specify them in the Condition element of RAM policy statements to define the conditions under which the statement takes effect. Use conditional operators that match the data type of the condition key. If the operator does not match, the statement does not take effect. For more information about conditional operators, see Condition operator.

Condition key

Description

Data type

vpc:VRouter The vRouter information. String
vpc:VPC The VPC information. String
vpc:tag The tags of the VPC. String
vpc:TargetAccountRDId The resource directory ID of the peer user. String
vpc:PhysicalConnection The Express Connect circuit information. String
vpc:VBR The border router information. String

References

For information about conditional operators, custom policies, and authorization operations, see the following documents: