cookieandcoke
cookieandcoke

Reputation: 78

Is there a way that invoke a AWS Lambda function between different VPC?

I has two Lambda functions, Function A access private subnet database so set in private VPC. Function B with no VPC setting, because it needs public network. Is there a way that can invoke function B by function A? Function A and B are synchronized.

Or if both function can be synchronized, is there any design that can solve this question? Such as function A publish event to SNS, function B subcribe SNS?

Upvotes: 0

Views: 1030

Answers (1)

Mark B
Mark B

Reputation: 200446

You always invoke a Lambda function via the public AWS API. The Lambda function's aren't running constantly waiting for network connections. An instance of the Lambda function doesn't even exist until AWS creates an instance in order to handle an invocation request that it has received. Configuring them both to be in the same VPC wouldn't even help anything here.

Your Lambda function A either needs to be in a private subnet with a route to a NAT Gateway, or it needs to be in a VPC with an AWS Lambda VPC Endpoint.

Upvotes: 2

Related Questions