aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.57k stars 1.55k forks source link

LakeFormation listPermissions returns abnormal result #4583

Closed HagunKim closed 4 months ago

HagunKim commented 4 months ago

Describe the bug

According to the document [1], I tried to get list of LF-tag expression permissions.

let result = [];
let params = {
    CatalogId: CatalogId,
    MaxResults: 1000,
    ResourceType: "LF_TAG_POLICY"
};
do {
    let response = await lakeformation.listPermissions(params).promise();
    result.push(...response.PrincipalResourcePermissions);
} while (response.PrincipalResourcePermissions.length > 0 && response.NextToken !== null);

Expected : The result has whose resource type is both DATABASE and TABLE. Actual : The result only has values whose resource type is DATABASE.

aws-sdk js version : aws-sdk@2.1557.0

[1] https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/LakeFormation.html#listPermissions-property

Expected Behavior

The response has whose resource type is both DATABASE and TABLE.

Current Behavior

The response only has values whose resource type is DATABASE.

Reproduction Steps

  1. Create LF-tag expression permissions for tables and databases
  2. run this code
    let result = [];
    let params = {
    CatalogId: CatalogId,
    MaxResults: 1000,
    ResourceType: "LF_TAG_POLICY"
    };
    do {
    let response = await lakeformation.listPermissions(params).promise();
    result.push(...response.PrincipalResourcePermissions);
    } while (response.PrincipalResourcePermissions.length > 0 && response.NextToken !== null);
  3. check the result

Possible Solution

No response

Additional Information/Context

No response

SDK version used

aws-sdk@2.1557.0

Environment details (OS name and version, etc.)

Ubuntu 20.04