{"version":"2.0","statement":[{"effect":"effect","action":["action"],"resource":["resource"],"condition": {"key":{"value"}}}]}
Parameter | Subparameter | Required | Description |
version | N/A | Yes | Currently, only the value 2.0 is allowed. |
statement | effect | Yes | It describes the result of a statement. The result can be "allow" or an "explicit deny". |
| action | Yes | It describes the allowed or denied operation which can be an API or a feature set (a set of specific APIs prefixed with permid ). |
| resource | Yes | It describes the details of authorization. All resources can be described in the six-segment format. Each service has its own resources and detailed resource definition. |
| condition | Yes | It describes the condition for the policy to take effect. A condition consists of operator, action key, and action value. A condition value may contain information such as time and IP address. A condition value may be the time, IP address, etc. Some services allow you to specify additional values in a condition. |
effect
, action
, resource
, and condition
. One policy has only one statement
.mongodb:
should be used for TencentDB for MongoDB, such as mongodb:BackupDBInstance
or mongodb:CreateAccountUser
.
To specify multiple operations in a single statement, separate them by comma:"action":["mongodb:action1","mongodb:action2"]
"action":["mongodb:Describe*"]
"action":["mongodb:*"]
qcs:project_id:service_type:region:account:resource
mongodb
.bj
.uin/12345678
.instance/instance_id
or instance/*
.resource
to an instance ID (cmgo-aw6g1g0z) in a statement as shown below:"resource":[ "qcs::mongodb:bj:uin/12345678:instance/cmgo-aw6g1g0z"]
"resource":[ "qcs::mongodb:bj:uin/12345678:instance/*"]
resource
element as shown below:"resource": ["*"]
"resource":["resource1","resource2"]
$
are placeholders, region
refers to a region, and account
refers to an account ID.Resource Type | Resource Description Method in Authorization Policy |
Instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
VPC | qcs::vpc:$region:$account:vpc/$vpcId |
Security Group | qcs::cvm:$region:$account:sg/$sgId |
Policy Name | Note |
QcloudMongoDBFullAccess | TencentDB for MongoDB management permission. A Tencent Cloud sub-account granted with this permission has the same permissions as the root account, including all permissions of console and API operations. |
QcloudMongoDBReadOnlyAccess | Read-only permission. A Tencent Cloud sub-account granted with this permission has only the read-only permission of all resources under the Tencent Cloud root account but not operation permissions of the console and APIs. |
QcloudMongoDFullAccess
is as follows:{"version": "2.0","statement": [{"action": ["monitor:GetMonitorData","monitor:DescribeBaseMetrics","mongodb:*"],"resource": "*","effect": "allow"}]}
QcloudMongoDBReadOnlyAccess
is as follows:{"version": "2.0","statement": [{"action": ["monitor:GetMonitorData","monitor:DescribeBaseMetrics","mongodb:Describe*"],"resource": "*","effect": "allow"}]}
Action Name | Permission Description | Resource Description |
BackupDBInstance | Backs up a database instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
CreateAccountUser | Creates an account | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
CreateDBInstanceHour | Creates a pay-as-you-go TencentDB for MongoDB instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DeleteAccountUser | Deletes an account | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeAccountUsers | Queries the user information of an account | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeBackupAccess | Gets the permission to download an instance backup | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeBackupRules | Gets the backup rules of a TencentDB instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeClientConnections | Gets the number of client connections | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeDBBackups | Queries the list of backups of an instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeDBInstances | Queries the list of database instances | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeInstanceDB | Queries the collection/database information of an instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeSlowLog | Gets the slow log information | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeSlowLogPattern | Gets the slow log statistics | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
DescribeSpecInfo | Queries purchasable instance specifications | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
ExchangeInstance | Replaces the original instance with a temp instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
IsolateDBInstance | Isolates a TencentDB instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
ModifyDBInstanceSpec | Adjusts the configurations of a TencentDB instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
OfflineIsolatedDBInstance | Deactivates an isolated TencentDB instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
RemoveCloneInstance | Deletes a temp instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
RenameInstance | Renames an instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
RenewInstance | Renews a TencentDB instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
ResizeOplog | Adjusts the oplog size of an instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
RestartInstance | Restarts an instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
RestoreDBInstance | Restores a database instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetAccountUserPrivilege | Sets user permissions | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetAutoRenew | Sets auto-renewal | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetBackupRules | Sets backup rules | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetInstanceFormal | Promotes a temp instance to the primary instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetInstanceMaintenance | Sets the instance maintenance time | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetPassword | Sets password | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
SetReadOnlyToNormal | Promotes a read-only instance to the primary instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
TerminateDBInstanceHour | Terminates a pay-as-you-go instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
UpgradeDBInstanceHour | Upgrades a pay-as-you-go instance | qcs::mongodb:$region:$account:instance/* qcs::mongodb:$region:$account:instance/$instanceId |
CreateDBInstance
and CreateAccountUser
permissions on the "cmgo-aw6g****" instance, you can create a policy as follows:{"version": "2.0","statement": [{"effect": "allow","action": ["mongodb:CreateDBInstance","mongodb:CreateAccountUser"],"resource": ["qcs::mongodb::uin/100001540306:instanceId/cmgo-aw6g****"],"condition": {"ip_equal": {"qcs:ip": ["10.0.0.4"]}}}]}
Was this page helpful?