情境


我在S3中托管了一个无服务器的React js应用。
我正在使用Cognito进行用户身份验证。
为Cognito身份验证角色配置了
quicksight:CreateUser权限。
我从S3中的数据文件将数据加载到Quicksight中,并创建了一个仪表板。


我正在使用以下代码从节点js(v8.10)lambda函数创建嵌入式仪表板URL。

const AWS = require('aws-sdk');
var quicksight = new AWS.QuickSight({
    region: 'us-east-1'
});
return quicksight.getDashboardEmbedUrl({
                'AwsAccountId': 'XXXXX',
                'DashboardId': 'YYYYYYY',
                'IdentityType': 'IAM',
                'ResetDisabled': true,
                'SessionLifetimeInMinutes': 100,
                'UndoRedoDisabled': false
            }).promise().then((res) => {
                console.log('Response: ');
                console.log(res);
            }).catch((err) => {
                console.log('Error: ');
                console.log(err);
            })


**

我收到以下错误。

**

2019-01-15T17:48:42.496Z    cafaa35a-18ed-11e9-9e84-ad156518dcbe    { UnknownError: Forbidden
at Object.extractError (/var/task/node_modules/aws-sdk/lib/protocol/json.js:51:27)
at Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/rest_json.js:52:8)
at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:685:12)
message: 'Forbidden',
code: 'UnknownError',
statusCode: 403,
time: 2019-01-15T17:48:42.440Z,
requestId: 'XXXX',
retryable: false,
retryDelay: 1.6256019461018845 }


2019-01-15T17:48:42.938Z    cafaa35a-18ed-11e9-9e84-ad156518dcbe    Error:
2019-01-15T17:48:42.938Z    cafaa35a-18ed-11e9-9e84-ad156518dcbe    { QuickSightUserNotFoundException: Could not find user information in QuickSight
at Object.extractError (/var/task/node_modules/aws-sdk/lib/protocol/json.js:51:27)
at Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/rest_json.js:52:8)
at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:685:12)
message: 'Could not find user information in QuickSight',
code: 'QuickSightUserNotFoundException',
time: 2019-01-15T17:48:42.938Z,
requestId: 'XXXXX,
statusCode: 412,
retryable: false,
retryDelay: 84.05706341238961 }


知道为什么会这样吗?我是否也必须在quicksight门户中添加用户?我认为快速视认-认知集成是即插即用。

在此先感谢您的帮助。

最佳答案

请参考以下线程,该线程给出了以编程方式生成嵌入式URL的详细过程。

How to get/generate aws quicksight secure dashboard url

关于node.js - 无法创建AW​​S Quicksight嵌入式仪表板URL,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54204522/

10-11 07:01