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")
已提問 2 年前檢視次數 1859 次
1 個回答
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)?

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南