Implement AWS Verified Permission using AWS Lambda

0

import { VerifiedPermissions } from "@aws-sdk/client-verifiedpermissions"; export const handler = async (event) => { try { var verifiedpermissions = await new VerifiedPermissions();

var params = {
  validationSettings: {
    mode: "OFF" /* required */,
  },
  clientToken: "d876e578-b6c6-4251-bbf5-6366c5d69abc",
};
const createPolicyStore_ = await verifiedpermissions.createPolicyStore(
  params
);
return createPolicyStore_;

} catch (error) { throw new Error(error); } }; This is my Lambda function. I have also integrated the AWS SDK for JavaScript into my Node.js Lambda function using layers. But I am getting the below error when implementing AWS Verified Permission with Lambda: "errorMessage": "AccessDeniedException: User: arn:aws:sts::xxxxxxxx:assumed-role/verifiedPermissionTest-role-cj3t6pqg/verifiedPermissionTest is not authorized to perform: verifiedpermissions:createpolicystore on resource: * because no identity-based policy allows the verifiedpermissions:createpolicystore action"

1回答
0

Hello.

Judging from the content of the error, it seems that the IAM role does not allow "verifiedpermissions:createpolicystore", but how is the IAM role configured?
https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonverifiedpermissions.html

profile picture
エキスパート
回答済み 6ヶ月前
profile pictureAWS
エキスパート
レビュー済み 6ヶ月前
  • But I have added the policy that permits the user to perform all the actions in Verified Permission.This is the policy statement: { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": "verifiedpermissions:", "Resource": "" } ] }

  • Please check again whether the settings are configured in the IAM role used by Lambda. Also, to check the operation, temporarily set strong privileges such as AdministratorAccess and see if it works without any problems. In other cases, it may be possible to check CloudTrail events and check the missing permissions.

  • not sure if cut/paste error because of formatting, but is Action "verifiedpermissions:" missing the * after the : - it should be "verifiedpermissions:*"

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ