cross account cross region API gateway lambda integration

0

I need to create a Cross account and cross-region API gateway and lambda Integration. I have my API gateway in Account A and Region 1 (It is already associated with a lambda function in the same region and account) .. now I want to integrate this API gateway with a lambda function in Account B and Region 2.

Any reference to documentation or blogs will be appreciated.

已提問 3 個月前檢視次數 194 次
2 個答案
0

Hello.

If it is cross-account, you can use Lambda with the settings in the document below.
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-cross-account-lambda-integrations.html

However, we have confirmed that it does not work well in the case of cross regions.
I will check it a bit more.

profile picture
專家
已回答 3 個月前
profile pictureAWS
專家
已審閱 3 個月前
  • We were able to confirm that it can be used cross-account if Lambda is in the same region as API Gateway. Although the cause is unknown in the case of a different region, we have confirmed that the following permission error occurs even if a resource-based policy is attached to Lambda.

    Execution failed due to configuration error: Invalid permissions on Lambda function
    
  • Hi Riku and Didier, I get a different error while testing the API gateway integration after attaching the necessary resource-based policy to the lambda: Latency 119 Status 500 Response body {"message": "Internal server error"} Response headers { "x-amzn-ErrorType": "InternalServerErrorException" }

0

Hi,

Like Riku, I believe that API GTW and Lambda must be in same region (but not necessarily in same account).

So, you can create a proxy Lambda that will get the input payload from Account A in Region 1 to call Lambda in region 2. You can go with a direct Lamdda invoke() from the proxy Lambda to call the real one.

Best,

Didier

profile pictureAWS
專家
已回答 3 個月前

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

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

回答問題指南