使用SDK连接到AWS Quicksight仪表板

时间:2019-08-30 10:47:55

标签: amazon-iam quicksight-embedding

我是AWS Quicksight的新手。开发人员正在使用https://www.npmjs.com/package/amazon-quicksight-embedding-sdk连接到Quicksight仪表板。

按照教程https://aws.amazon.com/blogs/big-data/embed-interactive-dashboards-in-your-application-with-amazon-quicksight/

我已使用以下策略创建了IAM ROLE QuickSightEmbed

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": "quicksight:RegisterUser",
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": "quicksight:GetDashboardEmbedUrl",
            "Resource": [
                "arn:aws:quicksight:us-east-1:xxxxxxxxxxx:dashboard/dashboardId",
                "arn:aws:quicksight:us-east-1:xxxxxxxxxxx:dashboard/dashboardID"
            ],
            "Effect": "Allow"
        }
    ]
}

我对在该角色中使用的可信任关系感到困惑。到目前为止,我已经将信任关系船添加到了IAM USER“ dev”中,并且信任关系看起来像

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::xxxxxxxxxx:user/dev"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

还使用以下规则创建了策略“ QuickSightAssume”

{
    "Version": "2012-10-17",
    "Statement": {
        "Effect": "Allow",
        "Action": "sts:AssumeRole",
        "Resource": "arn:aws:iam::xxxxxxxxxxxxx:role/QuickSightEmbed"
    }
}

我想知道是否应该在信任关系将角色传递给角色“ QuickSightEmbed”而不是该IAM用户时采用上述策略。 我试图添加策略arn,但失败了。我们是否应该在AWS SDK中使用该策略ARN?我们如何将该策略连接到“ QuickSightEmbed”角色?

按照带有以下命令的文档(已使用用户dev的密钥和accesskeyid配置了aws cli),我能够获得aws密钥,秘密ID和会话令牌,

aws sts assume-role --role-arn "arn:aws:iam::xxxxxxxxxx:role/QuickSightEmbed" --role-session-name someone@someone.com

someone@someone.com这是已经在quicksight上注册的用户

我使用另一个配置文件配置了aws cli,该配置文件具有我在上一条命令中获得的密钥和secretID并运行了以下

aws quicksight --profile新的get-dashboard-embed-url --aws-account-id xxxxxxxxxxx --dashboard-id“ dashboard ID” --identity-type IAM

但是它说无效的令牌,并且我没有得到仪表板签名的URL ...

是否需要在AWS skd中使用变量对其进行配置?

期待对此有所启发。

0 个答案:

没有答案