lambda connection timed out while accessing SQS

0

We are using Lamda and passing SQS que as environment variable and The lambda is in a VPC in Public subnet with Internetgateway attached, the role attached to the lambda has SQS Full access, but we are getting the error as below ""errorMessage": "Unable to execute HTTP request: Connect to sqs.ap-south-1.amazonaws.com:443 [sqs.ap-south-1.amazonaws.com/10.0.0.69, sqs.ap-south-1.amazonaws.com/10.0.0.39, sqs.ap-south-1.amazonaws.com/10.0.0.53] failed: connect timed out", "errorType": "com.amazonaws.SdkClientException",

gefragt vor einem Jahr424 Aufrufe
2 Antworten
0

To access SQS from a Lambda in a VPC, you must either create a VPC endpoint, create a NAT gateway, or manually set a public IP address in the Lambda's ENI.
If you are on a public subnet, it would be easy to set up a VPC endpoint.
https://docs.aws.amazon.com/ja_jp/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-sending-messages-from-vpc.html#create-vpc-endpoint-for-sqs

profile picture
EXPERTE
beantwortet vor einem Jahr
  • But even in Public subnet with IGW and Private With NAT still getting the error

  • Lambda does not have a public IP address when placed on a public subnet.
    So please set up a VPC endpoint for SQS

0

The answer from Riku_Kobayashi is correct but I'd like to comment on something else in the question:

The endpoint name is sqs.ap-south-1.amazonaws.com but the error you're getting shows that it is resolving to private IP addresses (10.0.0.69, 10.0.0.39, 10.0.0.53) and that's curious. Do you have anything in your VPC which is acting as a DNS server that is trying to send your traffic to some other endpoint?

profile pictureAWS
EXPERTE
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen