0
votes

When a Lambda is attached to one (or more) VPC subnets, the post call to data exchange api times out. And when the Lambda is detached from all subnets, then this post call succeeds. This is happening consistently in golang Lambda environment.

In my use case, I am accessing Redis from Lambda, and Redis is accessible only from within the VPC.

Error message: error=RequestError: send request failed caused by: Post https://dataexchange.us-east-1.amazonaws.com/v1/data-sets: dial tcp 52.85.148.96:443: i/o timeout

1
your lambda is in private subnet? - Marcin
yes @Marcin lambda is in private subnet. - Ghulam Mustafa
So that's why probably it can't communicate with dataexchenge endpoint. Have you setup NAT gateway in your VPC? - Marcin
No, i have not setup NAT gateway right now. Does NAT gateway needed for it ? - Ghulam Mustafa

1 Answers

0
votes

An AWS Lambda function running in a VPC will never be assigned a public IP address. So in order for the Lambda function to access resources that exist outside the VPC, such as the AWS Data Exchange service, the VPC will need to be configured with a NAT Gateway that provides Internet access to the private subnet(s) the Lambda function is deployed to.