GM_1
GM_1

Reputation: 75

AWS Data Exchange returing timeout error when accessed from lambda function that is within VPC

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

Upvotes: 0

Views: 970

Answers (1)

Mark B
Mark B

Reputation: 201118

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.

Upvotes: 1

Related Questions