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 年前1860 查看次数
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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则