Cognito Preauth函数的用户主体是什么?

0

【以下的问题经过翻译处理】 当您需要为Cognito预认证触发器授予IAM权限时,分配的角色是否像其他Lambda一样由'lambda.amazonaws.com'承担?还是触发器由Cognito服务原理'cognito-idp.amazonaws.com'运行?

我需要授予我的Lambda按ARN在特定表上执行dynamodb:GetItem的权限,但它不起作用。这可能是由于其他原因而不是这个原因。我认为答案是lambda.amazonaws.com,但想确认,主要是因为我找不到cognito-idp.amazonaws.com的用途。

profile picture
EXPERT
asked 6 months ago41 views
1 Answer
0

【以下的回答经过翻译处理】 Lambda策略具有资源策略,允许它以以下形式被Congito用户池访问: ''' { "Version": "2012-10-17", "Id": "default", "Statement": [ { "Sid": ",<Some SID>", "Effect": "Allow", "Principal": { "Service": "cognito-idp.amazonaws.com" }, "Action": "lambda:InvokeFunction", "Resource": "arn:aws:<region>:<AWS Account>:function:<Lambda function name>", "Condition": { "ArnLike": { "AWS:SourceArn": "arn:aws:cognito-idp:<region>:<AWS Account>:userpool/<User Pool ID>" } } } ] } ''' 但是,Lambda函数仍以lambda.amazonaws.com执行,必须通过与Lambda函数关联的Lambda Execution Role进行授权。

profile picture
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions