Development with AWS Services

A Lambda function attached to private subnets of a VPC can query an RDS database in that VPC, but its calls to Amazon SQS time out. Which change lets it reach SQS without giving the function internet access?

Show the answer

Correct answerC. Create an interface VPC endpoint for Amazon SQS in the VPC.

AWhy not this: A missing permission returns an access-denied error, not a network timeout.

BWhy not this: Gateway VPC endpoints are available only for Amazon S3 and DynamoDB.

CWhy this is right: An interface endpoint gives the VPC a private path to the SQS API without internet access.

DWhy not this: Lambda's network interfaces do not receive public IP addresses, so a public subnet does not provide internet access.

A VPC-attached function has no internet access, so it reaches public AWS APIs through a NAT gateway or a VPC endpoint; an interface endpoint (AWS PrivateLink) for SQS keeps traffic inside the VPC. Gateway endpoints exist only for S3 and DynamoDB, and Lambda network interfaces get no public IP even in a public subnet.