你如何授予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
EXPERTO
preguntada hace 6 meses3 visualizaciones
1 Respuesta
0

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

profile picture
EXPERTO
respondido hace 6 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas