I configured IAM permission policies to allow one AWS IAM user to invoke a lambda function which is owned by another AWS account, after applied the AWS Lambda plugin in Kong Gateway, I see errors like below:
[aws-lambda] User: arn:aws:iam::851725256956:user/sk2 is not authorized to pe
rform: lambda:InvokeFunction on resource: arn:aws:lambda:us-east-2:851725256956:function:sgao_test_func because no identity-based policy allows the lambda:InvokeFunction action, client: 10.0.0.1, server: kong, request: "GET /lambda HTTP/1.1", host: "localhost:8000", request_id: "f472d3038ca6f260129d74215c5cdd16"Note: this happens when correct AWS IAM permission policies and assumeRole permissions are in place, but missing the Aws Assume Role Arn value in the AWS Lambda plugin
Or
2024/03/21 14:30:44 [error] 2188#0: *1477941 [kong] init.lua:351 [aws-lambda] {"Message":"Cross-account log access is not allowed"}, client: 10.51.210.234, server: kong, request: "GET /platform/v1/download?id=3535345345 HTTP/1.1", host: "api.us.dev.contoso.cloud"}Note: this could happen when grant permissions directly to the IAM user in the other AWS account to invoke lambda functions in the target AWS account. However, this approach may increase the complexity of managing permissions across accounts, and it’s generally considered a better practice to use role assumption for cross-account access whenever possible.