- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
Hi, I don't know Node.js but it seems to me the only policy in your code for the role is "myPolicy" which is the Trust (AssumeRole) policy? I can't see any execution permissions, e.g. use of a managed policy like AWSLambdaBasicExecutionRole or your own custom one.
Thank you for the response Skisman, but I don't think that is the problem that I'm having right now, If I create the role and then run the function to add it to the lambda it works, it is just when I do it all in the same function. It looks like it needs to "wait until active" (I haven't found this option), I also tried adding delays but I get the same result
The issue is not about node js. This is the error: 2023-03-17T19:26:41.064Z 342fa261-e9d8-426d-9231-60d9409a76dc INFO InvalidParameterValueException: The role defined for the function cannot be assumed by Lambda. Which means that we need to add lambda service in the trust policy as explained [here] (https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)
One option is to dd this service to the the trust policy like this: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "sagemaker.amazonaws.com", "lambda.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] }
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
Hi just faced something similar to this, even boto3 waiter calls are useless, I had to add a 9s delay right after role creation and then create function worked!