Updated on 2024-07-24 GMT+08:00

GaussDB

The Organizations service provides Service Control Policies (SCPs) to set access control policies.

SCPs do not actually grant any permissions to a principal. They only set the permissions boundary for the principal. When SCPs are attached to a member account or an organizational unit (OU), they do not directly grant permissions to that member account or OU. Instead, the SCPs just determine what permissions are available for that member account or the member accounts under that OU.

This section describes the elements used by Organizations SCPs. The elements include actions, resources, and conditions.

For details about how to use these elements to create a custom SCP, see Creating an SCP.

Actions

Actions are specific operations that are allowed or denied in an SCP.

  • The Access Level column describes how the action is classified (List, Read, or Write). This classification helps you understand the level of access that an action grants when you use it in an SCP.
  • The Resource Type column indicates whether the action supports resource-level permissions.
    • You can use a wildcard (*) to indicate all resource types. If this column is empty (-), the action does not support resource-level permissions, and you must specify all resources ("*") in your SCP statements.
    • If this column includes a resource type, you must specify the URN in the Resource element of your statements.
    • Required resources are marked with asterisks (*) in the table. If you specify a resource in a statement using this action, then it must be of this type.

    For details about the resource types defined by GaussDB, see Resources.

  • The Condition Key column contains keys that you can specify in the Condition element of an SCP statement.
    • If the Resource Type column has values for an action, the condition key takes effect only for the listed resource types.
    • If the Resource Type column is empty (-) for an action, the condition key takes effect for all resources that action supports.
    • If the Condition Key column is empty (-) for an action, the action does not support any condition keys.

    For details about the condition keys defined by GaussDB, see Conditions.

The following table lists the actions that you can define in SCP statements for GaussDB.

Table 1 Actions supported by GaussDB

Action

Description

Access Level

Resource Type (*: required)

Condition Key

gaussdb:backup:createBackup

Grants permission to create a manual backup for a DB instance.

write

instance

-

gaussdb:backup:deleteBackup

Grants permission to delete a backup.

write

instance

-

gaussdb:backup:listAll

Grants permission to query backups.

list

instance

-

gaussdb:instance:updateBackupPolicy

Grants permission to configure a backup policy.

write

instance

gaussdb:BackupEnabled

gaussdb:param:applyParam

Grants permission to apply a parameter template.

write

instance

-

gaussdb:tag:create

Grants permission to add tags.

tagging

instance

-

gaussdb:instance:bindEIP

Grants permission to bind an EIP.

write

instance

-

gaussdb:instance:check

Grants permission to check instance information.

read

instance

-

gaussdb:instance:createInstance

Grants permission to create a DB instance.

write

instance

  • gaussdb:BackupEnabled
  • gaussdb:Encrypted

gaussdb:instance:createDatabase

Grants permission to create a database.

write

instance

-

gaussdb:instance:createDatabaseSchema

Grants permission to create a database schema.

write

instance

-

gaussdb:instance:createDatabaseUser

Grants permission to create a database account.

write

instance

-

gaussdb:instance:deleteInstance

Grants permission to delete a DB instance.

write

instance

-

gaussdb:instance:get

Grants permission to query DB instance information.

read

instance

-

gaussdb:instance:getBackupPolicy

Grants permission to query an automated backup policy.

read

instance

-

gaussdb:instance:getBalanceStatus

Grants permission to check whether host load is unbalanced due to a primary/standby switchover.

read

instance

-

gaussdb:instance:getDiskUsage

Grants permission to query disk usage.

read

instance

-

gaussdb:instance:getRecyclePolicy

Grants permission to query the recycling policy.

read

instance

-

gaussdb:instance:downloadSslCert

Grants permission to download the SSL certificate of a DB instance.

read

instance

-

gaussdb:instance:grantDatabasePrivilege

Grants permission to configure permissions of database accounts.

write

instance

-

gaussdb:instance:listAll

Grants permission to query DB instances.

list

instance

-

gaussdb:instance:listPublicIps

Grants permission to query EIPs bound to DB instances.

list

instance

-

gaussdb:instance:listComponents

Grants permission to query instance components.

list

instance

-

gaussdb:instance:listDatabases

Grants permission to query databases.

list

instance

-

gaussdb:instance:listDatabaseUsers

Grants permission to query database users.

list

instance

-

gaussdb:tag:listAll

Grants permission to query resource tags.

list

instance

-

gaussdb:quota:listAll

Grants permission to query quotas.

list

instance

-

gaussdb:instance:listRecoverableTimes

Grants permission to query the restoration time range.

list

instance

-

gaussdb:instance:listSchemas

Grants permission to query database schemas.

list

instance

-

gaussdb:instance:renameInstance

Grants permission to change a DB instance name.

write

instance

-

gaussdb:instance:resetPassword

Grants permission to change a database password.

write

instance

-

gaussdb:instance:resizeFlavor

Grants permission to change vCPUs and memory of a DB instance.

write

instance

-

gaussdb:instance:restartInstance

Grants permission to reboot a DB instance.

write

instance

-

gaussdb:instance:setRecyclePolicy

Grants permission to modify the recycling policy.

write

instance

-

gaussdb:instance:switchShard

Grants permission to switch roles of the primary and standby DNs in shards.

write

instance

-

gaussdb:instance:extend

Grants permission to perform scale-out operations.

write

instance

-

gaussdb:param:update

Grants permission to modify a parameter template.

write

instance

-

gaussdb:param:check

Grants permission to check a parameter template.

read

instance

-

gaussdb:param:copy

Grants permission to replicate a parameter template.

write

instance

-

gaussdb:param:createParam

Grants permission to create a parameter template.

write

instance

-

gaussdb:param:deleteParam

Grants permission to delete a parameter template.

write

instance

-

gaussdb:param:get

Grants permission to query details about a parameter template.

read

instance

-

gaussdb:param:compare

Grants permission to compare two parameter templates.

read

instance

-

gaussdb:param:listAll

Grants permission to query parameter templates.

list

instance

-

gaussdb:param:reset

Grants permission to reset a parameter template.

write

instance

-

gaussdb:quota:update

Grants permission to modify quotas.

write

instance

-

gaussdb:task:listAll

Grants permission to query tasks.

list

instance

-

gaussdb:task:delete

Grants permission to delete a task record.

write

instance

-

gaussdb:task:get

Grants permission to query task details.

read

instance

-

Each API of GaussDB usually supports one or more actions. The following table lists the supported actions and dependencies.

Table 2 Instance management

Permission

API

Action

Dependencies

Creating a DB instance

POST /v3/{project_id}/instances

gaussdb:instance:createInstance

-

Deleting a DB instance

DELETE /v3/{project_id}/instances/{instance_id}

gaussdb:instance:delete

-

Querying DB instances

GET /v3/{project_id}/instances

gaussdb:instance:listAll

-

Changing a database password

POST /v3/{project_id}/instances/{instance_id}/password

gaussdb:instance:resetPassword

-

Changing a DB instance name

PUT /v3/{project_id}/instances/{instance_id}/name

gaussdb:instance:rename

-

Rebooting a DB instance

POST /v3/{project_id}/instances/{instance_id}/restart

gaussdb:instance:restart

-

Switching roles of the primary and standby DNs in shards

POST /v3/{project_id}/instances/{instance_id}/switch-shard

gaussdb:instance:switchShard

-

Querying the components of a DB instance

GET /v3/{project_id}/instances/{instance_id}/components

gaussdb:instance:listComponents

-

Changing vCPUs and memory of a DB instance

PUT /v3/{project_id}/instance/{instance_id}/flavor

gaussdb:instance:resizeFlavor

-

Checking whether host load is unbalanced due to a primary/standby switchover

GET /v3/{project_id}/instances/{instance_id}/balance

gaussdb:instance:getBalanceStatus

-

Querying solution template settings

GET /v3/{project_id}/deployment-form

gaussdb:instance:listAll

-

Querying EIPs bound to DB instances

GET /v3/{project_id}/instances/{instance_id}/public-ips?offset={offset}&limit={limit}

gaussdb:instance:listPublicIps

-

Validating password strength

POST /v3/{project_id}/weak-password-verification

gaussdb:instance:check

-

Binding or unbinding an EIP

POST /v3/{project_id}/instances/{instance_id}/nodes/{node_id}/public-ip

gaussdb:instance:bindPublicIp

-

Querying the SSL certificate download address of a DB instance

GET /v3/{project_id}/instances/{instance_id}/ssl-cert/download-link

gaussdb:instance:downloadSslCert

-

Querying the instance quotas of a tenant

GET /v3/{project_id}/project-quotas?type={type}

gaussdb:quota:listAll

-

Table 3 Parameter configuration

Permission

API

Action

Dependencies

Obtaining parameter templates

GET /v3/{project_id}/configurations?offset={offset}&limit={limit}

gaussdb:param:listAll

-

Obtaining parameters of a specified DB instance

GET /v3/{project_id}/instances/{instance_id}/configurations

gaussdb:instance:get

-

Modifying parameters of a specified DB instance

PUT /v3/{project_id}/instances/{instance_id}/configurations

gaussdb:param:update

-

Creating a parameter template

POST /v3/{project_id}/configurations

gaussdb:param:createParam

-

Deleting a parameter template

DELETE /v3/{project_id}/configurations/{config_id}

gaussdb:param:delete

-

Querying details about a parameter template

GET /v3/{project_id}/configurations/{config_id}

gaussdb:param:get

-

Replicating a parameter template

POST /v3/{project_id}/configurations/{config_id}/copy

gaussdb:param:copy

-

Resetting a parameter template

POST /v3/{project_id}/configurations/{config_id}/reset

gaussdb:param:reset

-

Comparing two parameter templates

POST /v3/{project_id}/configurations/comparison

gaussdb:param:compare

-

Querying instances that a parameter template can be applied to

GET /v3/{project_id}/configurations/{config_id}/applicable-instances

gaussdb:instance:listAll

-

Checking whether a parameter template name exists

GET /v3/{project_id}/configurations/name-validation?name={name}

gaussdb:param:check

-

Applying a parameter template

PUT /v3/{project_id}/configurations/{config_id}/apply

gaussdb:param:apply

-

Querying application records of a parameter template

GET /v3/{project_id}/configurations/{config_id}/applied-histories

gaussdb:param:listAll

-

Querying the change history of a parameter template

GET /v3/{project_id}/configurations/{config_id}/histories

gaussdb:param:listAll

-

Table 4 Backup management

Permission

API

Action

Dependencies

Configuring an automated backup policy

PUT /v3/{project_id}/instances/{instance_id}/backups/policy

gaussdb:instance:updateBackupPolicy

-

Querying an automated backup policy

GET /v3/{project_id}/instances/{instance_id}/backups/policy

gaussdb:instance:getBackupPolicy

-

Querying backups

GET /v3/{project_id}/backups?instance_id={instance_id}&backup_id={backup_id}&backup_type={backup_type}&offset={offset}&limit={limit}&begin_time={begin_time}&end_time={end_time}

gaussdb:backup:listAll

-

Creating a manual backup

POST /v3/{project_id}/backups

gaussdb:backup:create

-

Deleting a manual backup

DELETE /v3/{project_id}/backups/{backup_id}

gaussdb:backup:delete

-

Querying the restoration time range

GET /v3/{project_id}/instances/{instance_id}/restore-time?date={date}

gaussdb:instance:listRecoverableTimes

-

Restoring data to a new DB instance

POST /v3/{project_id}/instances

gaussdb:instance:createInstance

-

Querying instances that can be used for backups and restorations

GET /v3/{project_id}/restorable-instances

gaussdb:instance:listAll

-

Querying the information of the original instance based on a specific point of time or a backup file

GET /v3/{project_id}/instance-snapshot?instance_id={instance_id}&backup_id={backup_id}&restore_time={restore_time}

gaussdb:instance:get

-

Table 5 DB engine versions and specifications

Permission

API

Action

Dependencies

Querying DB engine versions

GET /v3/{project_id}/datastore/versions

gaussdb:instance:listAll

-

Querying instance specifications

GET /v3/{project_id}/flavors?limit={limit}&offset={offset}&ha_mode={ha_mode}&version={version}&spec_code={spec_code}

gaussdb:instance:listAll

-

Querying DB engines

GET /v3/{project_id}/datastores

gaussdb:instance:listAll

-

Querying specifications that a DB instance can be changed to

GET /v3/{project_id}/instances/{instance_id}/available-flavors

gaussdb:instance:listAll

-

Table 6 Database and account management

Permission

API

Action

Dependencies

Creating a database

POST /v3/{project_id}/instances/{instance_id}/database

gaussdb:instance:createDatabase

-

Creating a database account

POST /v3/{project_id}/instances/{instance_id}/db-user

gaussdb:instance:createDatabaseUser

-

Creating a database schema

POST /v3/{project_id}/instances/{instance_id}/schema

gaussdb:instance:createDatabaseSchema

-

Configuring permissions of database accounts

POST /v3/{project_id}/instances/{instance_id}/db-privilege

gaussdb:instance:grantDatabasePrivilege

-

Changing a password for a database account

PUT /v3/{project_id}/instances/{instance_id}/db-user/password

gaussdb:instance:resetPassword

-

Querying databases

GET /v3/{project_id}/instances/{instance_id}/databases

gaussdb:instance:listDatabases

-

Querying database users

GET /v3/{project_id}/instances/{instance_id}/db-users

gaussdb:instance:listDatabaseUsers

-

Querying database schemas

GET /v3/{project_id}/instances/{instance_id}/schemas

gaussdb:instance:listSchemas

-

Table 7 Tag management

Permission

API

Action

Dependencies

Querying tags of a specific instance

GET /v3/{project_id}/instances/{instance_id}/tags

gaussdb:tag:listAll

-

Querying tags of a project

GET /v3/{project_id}/tags

gaussdb:tag:listAll

-

Querying predefined tags

GET /v3/{project_id}/predefined-tags

gaussdb:tag:listAll

-

Adding tags for a DB instance

POST /v3/{project_id}/instances/{instance_id}/tags

gaussdb:tag:create

-

Table 8 Storage management

Permission

API

Action

Dependencies

Querying the storage usage of a DB instance

GET /v3/{project_id}/instances/{instance_id}/volume-usage

gaussdb:instance:getDiskUsage

-

Querying the database disk type

GET /v3/{project_id}/storage-type?version={version}&ha_mode={ha_mode}

gaussdb:instance:listAll

-

Table 9 Quota management

Permission

API

Action

Dependencies

Modifying enterprise project quotas

PUT /v3/{project_id}/enterprise-projects/quotas

gaussdb:quota:update

-

Querying enterprise project quotas

GET /v3/{project_id}/enterprise-projects/quotas

gaussdb:quota:listAll

-

Table 10 Task management

Permission

API

Action

Dependencies

Obtaining task information

GET /v3/{project_id}/jobs?id={id}

gaussdb:task:get

-

Querying tasks

GET /v3/{project_id}/tasks

gaussdb:task:listAll

-

Deleting a task record

DELETE /v3/{project_id}/jobs/{job_id}

gaussdb:task:delete

-

Table 11 Recycle bin

Permission

API

Action

Dependencies

Modifying the recycling policy

PUT /v3/{project_id}/recycle-policy

gaussdb:instance:setRecyclePolicy

-

Querying the recycling policy

GET /v3/{project_id}/recycle-policy

gaussdb:instance:getRecyclePolicy

-

Querying all DB engine instances in the recycle bin

GET /v3/{project_id}/recycle-instances

gaussdb:instance:listAll

-

Resources

A resource type indicates the resources that an SCP applies to. If you specify a resource type for any action in Table 12, the resource URN must be specified in the SCP statements using that action, and the SCP applies only to resources of this type. If no resource type is specified, the Resource element is marked with an asterisk (*) and the SCP applies to all resources. You can also set condition keys in an SCP to define resource types.

The following table lists the resource types that you can define in SCP statements for GaussDB.

Table 12 Resource types supported by GaussDB

Resource Type

URN

instance

gaussdb:<region>:<account-id>:instance:<instance-id>

Conditions

A Condition element lets you specify conditions for when an SCP is in effect. It contains condition keys and operators.

  • The condition key that you specify can be a global condition key or a service-specific condition key.
    • Global condition keys (with the g: prefix) apply to all actions. Cloud services do not need to provide user identity information. Instead, the system automatically obtains such information and authenticates users. For details, see Global Condition Keys.
    • Service-specific condition keys (with the abbreviation of a service name plus a colon as the prefix, for example, gaussdb:) apply only to operations of the GaussDB service. For details, see Table 13.
    • The number of values associated with a condition key in the request context of an API call makes the condition key single-valued or multivalued. Single-valued condition keys have at most one value in the request context of an API call. Multivalued condition keys can have multiple values in the request context of an API call. For example, a request can originate from at most one VPC endpoint, so g:SourceVpce is a single-valued condition key. You can tag resources and include multiple tag key-value pairs in a request, so g:TagKeys is a multivalued condition key.
  • A condition operator, condition key, and a condition value together constitute a complete condition statement. An SCP can be applied only when its request conditions are met. For supported condition operators, see Condition operators.

The following table lists the condition keys that you can define in SCPs for GaussDB. You can include these condition keys to specify conditions for when your SCP is in effect.

Table 13 Service-specific condition keys supported by GaussDB

Service-specific Condition Key

Type

Single-valued/Multivalued

Description

gaussdb:BackupEnabled

boolean

Single-valued

Filter access permissions based on the tag key of whether to enable the backup policy transferred in the request parameter. Select Default for Qualifier.

gaussdb:Encrypted

boolean

Single-valued

Filter access permissions based on the tag key of whether to enable disk encryption transferred in the request parameter. Select Default for Qualifier.