Error "The security token included in the request is invalid" invoking lambda function url

0

Hi,

This is the follow up of this question - https://repost.aws/questions/QUE8NpRj91RW-9p1MiOv9iYQ/calling-iam-auth-function-urls-from-lambda

I am trying to invoke the lambda with function url (lets name this as "funcUrlLambda" ) from another lambda (lets say this as "apiGwLambda"). I have given apiGwLambda role permission in funcUrlLambda. In apiGwLambda, I am doing the signv4 with the access key and secret key from lambda env variables.

For signV4, I am using the code from these links https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-examples-using-sdks.html#sig-v4-examples-using-sdk-java https://docs.aws.amazon.com/AmazonS3/latest/API/samples/AWSS3SigV4JavaSamples.zip

But I am getting this error {"message":"The security token included in the request is invalid."} from funcUrlLambda. It would be super helpful if some one could provide help on this ?

Code getting the access key and secret key in lambda

        val accessKey = System.getenv("AWS_ACCESS_KEY_ID")
        val secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
1 réponse
0

Hi, I would suggest that you try the Lambda URL with No-Auth option first, just to pinpoint the issue: is it related to the execution role (permissions) of the apiGwLambda, or, is it purely related to access tokens provided.

Could you provide the policy used by the execution role of apiGwLambda as well (assuming this is the lambda that will actually invoke funcUrlLambda)?

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions