The role/policy-based authorization model provided by Identity and Access Management (IAM) lets you control access to DLI resources. With IAM, you can:
If your account does not need individual IAM users, you may skip over this section.
Process Flow shows the process flow of role/policy-based authorization.
Before granting permissions to a user group, familiarize yourself with the DLI permissions that can be added to the user group and select them as needed.
For details about the system permissions of other services, see Permissions.
Figure 1 Process for granting DLI permissions

No. | Step | Description |
|---|---|---|
1 | Create a user group and grant permissions to it. | Create a user group on the IAM console and grant the DLI ReadOnlyAccess permission to it. |
2 | Create a user and add them to the user group. | Create a user on the IAM console and add them to the created user group. |
3 | Log in as the IAM user and verify permissions. | Log in to the console using the newly created user, switch to the authorized region, and verify permissions.
|
4 | Create a custom policy and associate it with the user group. | If the predefined DLI permissions in the system do not meet your authorization requirements, you can create custom policies. For details about how to create a custom policy, see Creating a Custom Policy. |
If the predefined DLI permissions in the system do not meet your authorization requirements, you can create custom policies. For the actions that can be added to custom policies, refer to "Permission Policies and Supported Actions" in Data Lake Insight API Reference.
You can create custom policies in either of the following two ways:
In the following example, an IAM user is granted the permission to create tables across all databases in all regions.
{"Version": "1.1","Statement": [{"Effect": "Allow","Action": ["dli:database:createTable"],"Resource": ["dli:*:*:database:*"]}]}
Version: 1.1. Policy: A fine-grained authorization strategy that defines the permissions required to perform actions on a specific cloud resource under certain conditions.
Function. The value can be Allow and Deny. If both Allow and Deny are found in statements, the Deny overrides the Allow.
Specific action on a resource. A maximum of 100 actions are allowed.
Determines when a policy is in effect. A condition consists of a condition key and a condition operator.
A key in the Condition element of a statement. There are global and service-specific condition keys.
An operator must be used together with a condition key to form a complete condition statement. For details, see Table 2.
IAM provides a set of DLI predefined condition keys. The following table lists the DLI predefined condition keys.
Condition Key | Type | Operator | Description |
|---|---|---|---|
g:CurrentTime | Global | Date and time | Time when an authentication request is received NOTE: The time is expressed in the format defined by ISO 8601, for example, 2012-11-11T23:59:59Z. |
g:MFAPresent | Global | Boolean | Whether multi-factor authentication is used during user login |
g:UserId | Global | String | ID of the current login user |
g:UserName | Global | String | Current login username |
g:ProjectName | Global | String | Project that you have logged in to |
g:DomainName | Global | String | Domain that you have logged in to |
The format is Service name:Region:Domain ID:Resource type:Resource path. The wildcard (*) indicates all options. For details about the resource types and path, see Table 5.
Example:
dli:*:*:queue:* indicates all queues.
You can set actions and resources at varying levels based on scenarios.
The format is Service name:Resource type:Action. You can use wildcards *. Example:
Action | Description |
|---|---|
dli:queue:submit_job | Submission operations on a DLI queue |
dli:queue:* | All operations on a DLI queue |
dli:*:* | All operations on all DLI resource types |
The format is Service name:Region:Domain ID:Resource type:Resource path. The wildcard (*) indicates all resources. You can flexibly set these five fields. The Resource path field can be set with varying levels of access control based on the specific scenario. If you need to set permissions for all resources under this service, you can leave this field unspecified.
For details about how to define a resource, see Table 4.
For details about the resource types and resource paths, see Table 5.
Resource | Description |
|---|---|
DLI:*:*:table:databases.dbname.tables.* | DLI, any region, any account ID, all table resources of database dbname |
DLI:*:*:database:databases.dbname | DLI, any region, any account ID, resource of database dbname |
DLI:*:*:queue:queues.* | DLI, any region, any account ID, any queue resource |
DLI:*:*:jobs:jobs.flink.1 | DLI, any region, any account ID, Flink job whose ID is 1 |
Type | Resource | Path |
|---|---|---|
elasticresourcepool | DLI elastic resource pool | elasticresourcepools.name |
queue | DLI queue | queues.queuename |
database | DLI database | databases.dbname |
table | DLI table | databases.dbname.tables.tbname |
column | DLI column | databases.dbname.tables.tbname.columns.colname |
jobs | DLI Flink job | jobs.flink.jobid |
resource | DLI package | resources.resourcename |
group | DLI package group | groups.groupname |
datasourceauth | DLI datasource authentication information | datasourceauth.name |
edsconnections | Enhanced datasource connection | edsconnections.Connection ID |
variable | DLI global variable | variables.name |
sqldefendrule | SQL inspection rule | sqldefendes.* |
catalog | DLI data catalog | catalogs.name |
Create a policy that grants users the permission to create and delete databases, submit jobs for any queue, and delete tables under any account ID in any region of DLI.
{"Version": "1.1","Statement": [{"Effect": " Allow","Action": ["dli:database:createDatabase","dli:database:dropDatabase","dli:queue:submitJob","dli:table:dropTable"],"Resource": ["dli:*:*:database:*","dli:*:*:queue:*","dli:*:*:table:*"]}]}
{"Version": "1.1","Statement": [{"Effect": "Allow","Action": ["dli:database:createTable"],"Resource": ["dli:*:*:database:*"]}]}
{"Version": "1.1","Statement": [{"Effect": "Allow","Action": ["dli:column:select"],"Resource": ["dli:*:*:column:databases.db.tables.tb.columns.col"]}]}
A deny policy must be used together with other policies. Users need to be granted some operation permission policies first before a deny policy can be set within those permissions. Otherwise, if the user has no permissions at all, the deny policy has no practical effect.
In the policies granted to a user, if an action has both Allow and Deny, the Deny takes precedence.
{"Version": "1.1","Statement": [{"Effect": "Deny","Action": ["dli:database:createDatabase","dli:database:dropDatabase","dli:queue:submitJob","dli:table:dropTable"],"Resource": ["dli:*:*:database:*","dli:*:*:queue:*","dli:*:*:table:*"]}]}
{"Version": "1.1","Statement": [{"Effect": "Deny","Action": ["dli:queue:submitJob"],"Resource": ["dli:*:*:queue:queues.demo"]}]}
Resources are objects that exist within a service. In DLI, resources include the following, and you can select specific resources when creating custom policies by specifying the resource path.
Type | Resource | Path |
|---|---|---|
elasticresourcepool | DLI elastic resource pool | elasticresourcepools.name |
queue | DLI queue | queues.queuename |
database | DLI database | databases.dbname |
table | DLI table | databases.dbname.tables.tbname |
column | DLI column | databases.dbname.tables.tbname.columns.colname |
jobs | DLI Flink job | jobs.flink.jobid |
resource | DLI package | resources.resourcename |
group | DLI package group | groups.groupname |
datasourceauth | DLI datasource authentication information | datasourceauth.name |
edsconnections | Enhanced datasource connection | edsconnections.Connection ID |
variable | DLI global variable | variables.name |
sqldefendrule | SQL inspection rule | sqldefendes.* |
catalog | DLI data catalog | catalogs.name |
Request conditions are useful in determining when a custom policy is in effect. A request condition consists of condition keys and operators. Condition keys are either global or service-level and are used in the Condition element of a policy statement. Global condition keys (starting with g:) are available for operations of all services, while service-level condition keys (starting with a service name such as dli) are available only for operations of a specific service. An operator must be used together with a condition key to form a complete condition statement.
IAM provides a set of DLI predefined condition keys. The following table lists the DLI predefined condition keys.
Condition Key | Type | Operator | Description |
|---|---|---|---|
g:CurrentTime | Global | Date and time | Time when an authentication request is received NOTE: The time is expressed in the format defined by ISO 8601, for example, 2012-11-11T23:59:59Z. |
g:MFAPresent | Global | Boolean | Whether multi-factor authentication is used during user login |
g:UserId | Global | String | ID of the current login user |
g:UserName | Global | String | Current login username |
g:ProjectName | Global | String | Project that you have logged in to |
g:DomainName | Global | String | Domain that you have logged in to |