tencent cloud

Virtual Private Cloud

Release Notes and Announcements
Release Notes
Announcements
Tencent Cloud Network Overview
Product Introduction
Overview
Strengths
Use Cases
Concepts
Quota Limit
Service Regions and Service Providers
Purchase Guide
Billing Overview
Payment Overdue
Quick Start
Network Planning
VPC Connections
Building Up an IPv4 VPC
Operation Guide
Network Topology
Network performance dashboard
Virtual Private Cloud (VPC)
Subnets
Route Tables
Elastic IP
HAVIPs
Elastic Network Interface
Bandwidth Package
Network Connection
Security Management
Diagnostic Tools
Alarming and Monitoring
Practical Tutorial
View the Total Bandwidth for Single-Region Traffic-Based Billing
Migrating from the Classic Network to VPC
Best Practices of Security Group Change
Configuring CVM Instance as Public Gateway
Building HA Primary/Secondary Cluster with HAVIP + Keepalived
Hybrid Cloud Primary/Secondary Communication (DC and VPN)
Hybrid Cloud Primary/Secondary Communication (CCN and VPN)
CVM Access to Internet Through EIP
Troubleshooting
VPCs or Subnets Cannot Be Deleted
Network Disconnection After Connecting Two VPCs over CCN
Failed to Ping CVMs in the Same VPC
API Documentation
History
Introduction
API Category
Making API Requests
VPC APIs
Route Table APIs
Elastic Public IP APIs
Elastic IPv6 APIs
Highly Available Virtual IP APIs
ENI APIs
Bandwidth Package APIs
NAT Gateway APIs
Direct Connect Gateway APIs
Cloud Connect Network APIs
Network ACL APIs
Network Parameter Template APIs
Network Detection-Related APIs
Flow Log APIs
Gateway Traffic Monitor APIs
Private Link APIs
Traffic Mirroring APIs
Other APIs
Subnet APIs
VPN Gateway APIs
Security Group APIs
Snapshot Policy APIs
Error Codes
Data Types
FAQs
General
Connection
Security
Contact Us
Glossary

Authorizable Resource Types

PDF
Focus Mode
Font Size
Last updated: 2024-10-22 16:16:26

Policy Syntax

CAM policy:
{
"version":"2.0",
"statement":
[
{
"effect":"effect",
"action":["action"],
"resource":["resource"],
"condition": {"key":{"value"}}
}
]
}
version is required. Currently, only the "2.0" value is allowed.
statement describes the details of one or more permissions. This element contains a permission or permission set of other elements such as effect, action, resource, and condition. Each policy has one statement element.
1.1 action describes the action to be allowed or denied. An action can be an API (described using the prefix "name") or a feature set (a set of specific APIs described with the prefix "permid"). This element is required.
1.2 resource describes the details of authorization. A resource is described in a six-piece format. Detailed resource definitions vary by product. For more information on how to specify a resource, see the documentation for the product whose resources you are writing a statement for. This element is required.
1.3 condition describes the condition for the policy to take effect. A condition consists of an operator, an action key, and an action value. A condition value may contain information such as the time and IP address. Some services allow you to specify additional values in a condition. This element is optional.
1.4 effect describes whether the result produced by the statement is "allow" or "deny". This element is required.

VPC Operations

In the statement of a CAM policy, you can specify any API action from any service that supports CAM. For VPC, use APIs with the prefix "name/vpc:", for example, name/vpc:Describe or name/vpc:CreateRoute. To specify multiple actions in a single statement, separate them with commas, as shown below:
"action":["name/vpc:action1","name/vpc:action2"]
You can also specify multiple actions by using a wildcard. For example, you can specify all actions whose names begin with "Describe", as shown below:
"action":["name/vpc:Describe*"]
To specify all actions in VPC, use the wildcard "*" as follows:
"action": ["name/vpc:*"]

VPC Resource Paths

Each CAM policy statement has its own resources. The general format of a resource path is as follows:
****qcs**:project_id:service_type:region:account:resource**
project_id: project information. This element is only used to enable compatibility with legacy CAM logic and can be left empty.
service_type: the product abbreviation, such as VPC.
region: region information, such as bj.
account: the root account of the resource owner, such as uin/164256472.
resource: resource details of each product, such as vpc/vpc_id1 or vpc/*.
For example, you can specify an instance (vpc-d08sl2zr in this case) in the statement, as shown below:
"resource":[ "qcs::vpc:bj:uin/164256472:instance/vpc-d08sl2zr"]
You can also use the wildcard "*" to specify all instances under a specific account, as shown below:
"resource":[ "qcs::vpc:bj:uin/164256472:instance/*"]
To specify all resources or if any API action does not support resource-level permissions, you can use the wildcard "*" in the Resource element, as shown below:
"resource": ["*"]
To specify multiple resources in one instruction, separate them with commas. In the following example, two resources are specified:
"resource":["resource1","resource2"]
The following table describes the resources that can be used by VPC and the corresponding methods of describing these resources.
In the following table, the words prefixed with "$" are all alternative names.
project indicates the project ID.
region indicates the region.
account indicates the account ID.
Resource
Resource Description Method in the Authorization Policy
VPC
qcs::vpc:$region:$account:vpc/$vpcId
Subnet
qcs::vpc:$region:$account:subnet/$subnetId
Security group
qcs::cvm:$region:$account:sg/$sgId
EIP
qcs::cvm:$region:$account:eip/*

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback