Hung
Hung

Reputation: 519

How does Lambda within subnet access VPC endpoint?

I have a lambda function within a VPC that rotates rds password. When I test lambda function with secret manager vpc endpoint as following:

I know I should not put the lambda function into public subnet but I want to know how lambda function within subnet works with vpc endpoint.

Can anyone explains why Case 2 is OK although lambda and vpc endpoint are in different subnets.

Upvotes: 3

Views: 3935

Answers (1)

Marcin
Marcin

Reputation: 238487

why Case 2 is OK

VPC interface endpoints have vpc scope, not subnet scope. This explains why cases 2,1 and 4 work. Because of that, case 3 should also work. Thus, the question is why case 3 did not work?

Possible reasons are that in your tests you made some configuration mistake (wrong security group, for example), or put lambda in a wrong VPC, did not enable Private DNS for the endpoint. Thus I would recommend double checking all the configurations for Case 3 and re-run the experiment.

Upvotes: 3

Related Questions