Hologres uses the Alibaba Cloud account system for user authentication. This topic introduces the account concepts used in Hologres.
Account types
Hologres is deeply integrated with the Alibaba Cloud account system. The primary account types are Alibaba Cloud accounts and RAM users, as described in the following table. To grant permissions to an Alibaba Cloud account or a RAM user in a Hologres instance, use their corresponding login account or account ID. For more information, see Login accounts and Account IDs.
|
Type |
Description |
|
Alibaba Cloud account |
You use an Alibaba Cloud account to create and manage Hologres instances. For example, you can use it to log on to the Hologres console, create databases, convert a pay-as-you-go instance to a subscription, and grant permissions to objects. |
|
RAM user |
Once authorized by an Alibaba Cloud account, a RAM user can create and manage instances. This includes logging on to the Hologres console, creating databases, converting a pay-as-you-go instance to a subscription, and granting permissions to objects. RAM users belong to an Alibaba Cloud account and do not own any resources. All resources belong to the root account. |
|
custom account |
A custom account is used to perform operations on an instance, such as creating or deleting databases, connecting to databases, and creating or deleting tables and views. Note
This account type uses the |
Login accounts
To grant permissions to an Alibaba Cloud account or a RAM user, use the login account of the Alibaba Cloud account. To find this information, go to the Security Settings page. On your account profile page, you can find details such as the Login Account and Account ID.
-
To grant permissions to an Alibaba Cloud account, the full format of the account name includes the login account information, as shown in the following table:
Format
Description
Example
ALIYUN$<Login Account>@aliyun.com
<Login Account> is the login account of the Alibaba Cloud account.
ALIYUN$company***@aliyun.com
<Login Account>@aliyun.com
company***@aliyun.com
-
To grant permissions to a RAM user, the full format of the username includes the login account information, as shown in the following table:
Format
Description
Example
<subUserName>@<Login Account>.onaliyun.com
The parameters are defined as follows:
-
<subUserName>: The name of the RAM user.
-
<Login Account>: The login account of the root account.
-
<AccountID>: The Alibaba Cloud account ID.
holouser***@company.onaliyun.com
<subUserName>@<Login Account>
holouser@company
<subUserName>@<Account ID>.onaliyun.com
holouser@123456789xxxx
RAM$<subUserName>
RAM$holo_test
RAM$<Login Account>:<subUserName>
RAM$company:holouser
RAM$<Account ID>:<subUserName>
RAM$123456789xxxx:holouser
<subUserName>@<Account ID>
holouser@123456789xxxx
-
Account IDs
An account ID is a numeric string, for example, 189813715xxxx. Obtain the account ID from the Security Settings page. The Account ID field is in the Basic Information section.
The account ID of a RAM user is its UID. To obtain the UID, go to the RAM users page in the RAM console and click the name of the target user. When you grant permissions to a RAM user by UID in Hologres, you must use the format p4_UID, for example, p4_12333388xxx. In the user's basic information section, the UID field is the account ID.
You can use an account ID to grant permissions in Hologres. The following statements are examples:
CREATE USER "189813715xxxx"; --Add the Alibaba Cloud account with the ID 189813715xxxx to Hologres.
CREATE USER "p4_12333388xxx" superuser; --Grant the superuser role to the RAM user with the UID 12333388xxx.
In Hologres, run the following statement to view the account ID of the current user:
SELECT current_user;
AccessKey ID and AccessKey secret
Use the Alibaba Cloud AccessKey ID and AccessKey secret to connect to and access Hologres instances. An AccessKey ID is like a login account, and an AccessKey secret is like a password. You can view them on the Security Management page in the Alibaba Cloud console.
The AccessKey ID and AccessKey secret are access credentials issued by Alibaba Cloud that expire. If your AccessKey ID and AccessKey secret expire, see Create an AccessKey pair to create a new pair.
When connecting to a Hologres instance with a tool such as psql or JDBC, use your AccessKey ID as the username and your AccessKey secret as the password.
Custom accounts
A custom account is used to perform operations on an instance within its permission scope, such as creating or deleting databases, connecting to databases, and creating or deleting tables and views. Custom accounts can be used only within a Hologres instance. For information about how to create a custom account, see Create a custom user.
By default, a custom account cannot be used to query external tables in MaxCompute. To enable this, you must configure a user mapping. For more information, see FAQ.