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:*"

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인