你如何授予iot:DescribeEndpoint权限给lambda ?

0

【以下的问题经过翻译处理】 如何将一个操作添加到默认的Lambda角色中?

        const p = new iam.ServicePrincipal('lambda.amazonaws.com');
        const role = new iam.Role(this, "someExecRoleID", {
                roleName: "someExecRole",
                assumedBy: p
            });
        role.grant(p, "iot:DescribeEndpoint");

        const serviceLambda = new nodejs.NodejsFunction(this, "WashnetEndpoints", {
                /* stuff deleted */
                handler: "getMqttEndpoint",
                role: role,
            }
        );

下面的错误,是因为我使用了lambda.amazonaws.com的service principal吗?

"AccessDeniedException: User: arn:aws:sts::312345678:assumed-role/blah is not authorized to perform: iot:DescribeEndpoint because no identity-based policy allows the iot:DescribeEndpoint action",
profile picture
专家
已提问 5 个月前3 查看次数
1 回答
0

【以下的回答经过翻译处理】 找到了文档(这通常是最困难的部分!)...似乎需要在resource部分配置“*”

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则