How to allow the Lambda functions to access the Neptune DB cluster in a different VPC?

0

A company is running a serverless application that consists of several AWS Lambda functions and Amazon DynamoDB tables. The company has created new functionality that requires the Lambda functions to access an Amazon Neptune DB cluster The Neptune DB cluster is located in three subnets in a VPC.

Which of the possible solutions will allow the Lambda functions to access the Neptune DB cluster and DynamoDB tables? (Select TWO )

A. Create three public subnets in the Neptune VPC and route traffic through an interne: gateway Host the Lambda functions m the three new public subnets

B. Create three private subnets in the Neptune VPC and route internet traffic through a NAT gateway Host the Lambda functions In the three new private subnets.

C. Host the Lambda functions outside the VPC. Update the Neptune security group to allow access from the IP ranges of the Lambda functions.

D. Host the Lambda functions outside the VPC. Create a VPC endpoint for the Neptune database, and have the Lambda functions access Neptune over the VPC endpoint

E. Create three private subnets in the Neptune VPC. Host the Lambda functions m the three new isolated subnets. Create a VPC endpoint for DynamoDB. and route DynamoDB traffic to the VPC endpoint.

The correct answer is A and C. My doubt is why B is not chosen instead of A.

  • C is actually an incorrect answer. Neptune (at the time of this writing) does not allow for public access outside of a VPC unless there is a proxy in place like a load balancer. Is this from an exam?

4개 답변
0

Is it because of NAT Gateway cost considerations?
I expected this to be because A and C would cost less than B, although it is certainly possible with B.
However, it is difficult to accurately consider this because there is no assumption from the problem statement to choose the one with the lowest cost.

profile picture
전문가
답변함 일 년 전
0

If you need a Lambda function to access resources in a VPC, you can either expose those resources publicly , which is usually not recommended, or attach the function to the VPC.

Exposing the resource publicly, may indicate to answer C, however, for this to work it is not enough to change security groups, you actually need to locate the Neptune cluster in public subnets and assign public IPs to the cluster. Based on this, it is not possible, so option C is not a correct answer.

So this means that you must attach the function to the VPC. You can attach the function to a Public subnet (option A), but that actually will not let the functions communicate the internet, as they do not have a public IP address in this case. This eliminates answer A as well.

You must attach the function to private subnets and then you need to give it a way to communicate with DDB. There are only two options for that: Either use a NAT gateway (option B), or use a DynamoDB VPC end point (option E).

So the correct answers are B and E.

profile pictureAWS
전문가
Uri
답변함 일 년 전
0

Hi, I concur that B and E should be correct, as hosting lambdas on public subnet is not really a good security practice, together with hosting data sources on public ones.

Typically these questions may depend on how things are asked, but the question does not really put any specific constraint.

profile picture
전문가
답변함 일 년 전
0

B and E in my opinion as both require the Lambda to be hosted in private subnets.

답변함 3달 전

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

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

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

관련 콘텐츠