Is it possible to communicate directly between 2 APIGateways in the same account?

0

I created a first APIGateway A (sub1.custom-domain.com) with a couple of apis and I have another APIGateway B (sub2.custom-domain.com) within the same account. I have an API /items in ApiGateway A that requires to call another API /providers that is located in the ApiGateway B. I tried to add a role to the lambda function items_lambda to invoke the ApiGateway B but it returns an error 403 Forbidden.

That's the policy I added in order to invoke the apis from ApiGateway B but it does not fix the issue.

{
       Version = "2012-10-17"
       Statement = [{
          Action = "execute-api:Invoke",
          Effect =  "Allow",
          Resource = "arn:aws:execute-api:${region}:*:*/*"
    }]}

Does the policy wrong or should I make the called resource more specific to access the exact path?

1개 답변
0

It seems you are not invoking API B directly from API A, but rather, API A calls a Lambda that calls API B.

It also seems that you are using IAM auth for API B. If this is case, your Lambda function must sign the requests going to API using SigV4 with the credentials obtained from the role.

profile pictureAWS
전문가
Uri
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠