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 Respuesta
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
EXPERTO
respondido hace 6 meses
profile pictureAWS
EXPERTO
revisado hace 6 meses
  • 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:*"

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