设想
- 我有一个托管在 S3 中的无服务器反应 js 应用程序。
- 我正在使用 Cognito 进行用户身份验证。
- 使用quicksight:CreateUser权限 配置 Cognito 身份认证角色 。
- 我从 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 门户中添加用户?我认为快速视觉认知集成是即插即用的。
提前感谢您的帮助。