1

I have API gateway set up in account A and I have linked my lambda in account B with my api method in account A (added the correct permissions to account B). It always used to worked perfectly.

Now when I tried to deploy a change to the api gateway it keeps saying "The policy of Lambda function must explicitly authorize the method or custom authorizer with a SourceArn condition for cross account integration".

I have checked multiple times, all the permission are there in account B on the lambda function. I even deleted them and added them again. If I add the permission for just the lambda function without the alias it works, but when I add my alias then I get the "The policy of Lambda function must explicitly authorize the method or custom authorizer with a SourceArn condition for cross account integration" error, but I can see the permissions for my lambda with the alias in account B.

What am I doing wrong?

Jonathan Irwin
  • 5,009
  • 2
  • 29
  • 48
Clarissa
  • 11
  • 2
  • This happened to me when trying to deploy an API using AWS CDK and OpenAPI 3.0 spec. Turned out I had the wrong account ID in the `x-amazon-apigateway-integration` section of the OpenAPI spec for each API method. – Aurelia Peters Nov 10 '22 at 18:44

0 Answers0