Api gateway calling lambda in different account

Hi,
How can I specify apigateway resource which would point lambda from different account. Is there any place I can point lambda arn in the script?

Thanks T.

Hi Tom,

I might be incorrect, but this problem looks to be more or less like the problem you wanted to access another APIGW in a different account but use that as your event trigger?

So serverless deals with specifying your apigateways (already configured ones) in providers spec, something like this

provider:
name: aws
region: ap-south-1
memorySize: 512
runtime: nodejs14.x
stackName: pia-db-ingestion-stack-api
stackTags:
Org: HashedIn
Product: PR001
Dep: HU
httpApi:
id: 6ser0pzuj2 (This is the APIGW id)
vpc:
securityGroupIds:
- sg-6386341e
subnetIds:
- subnet-05cf6b7f357a02e11
(This is the VPC and subnets where the lambda will be deployed to)

but the problem of accessing your APIGW in a different gateway, is a Networking problem and it should be addressed there in my opinion,
I am not an expert in networking, but VPC peering might help .

Hi,
Thank you for a quick reply!
Let me paraphrase my problem.

  1. I have two account - A - generic account, B - sub-account (let’s not discuss why is that this way - historically)
  2. On account A I have lambdaA and agA as a trigger (lambda proxy) for this lambda.
  3. Now I would like to setup agB (in B sub0account) trigerring lambdaA.

I’ve already managed to do that thorugh aws console - it just required me to point full lambdaA ARN when setting up agB + some access policy on lambdaA.

Now I would like to set this up through serverless, bu not sure how would I point those two to ‘look’ at each other.

Many thanks,
T.