0

I am getting a response when I am requesting to below URL using Axios from locally. Even it's working as expected in Postman request.

But when I am trying the same code base from lambda, I am getting a timeout error (after 60 seconds). I haven't done any particular configuration with lambda like lambda is not attached with any VPC.

let config = {
    method: 'GET',
    url: 'https://media.gucci.com/style/DarkGray_Center_0_0_490x490/1576869304/406994_BLM00_1000_001_100_0000_Light-Gucci-Jordaan-leather-loafer.jpg',
    headers: { 
      Host: "media.gucci.com",
    }
  };
  
  const res = await axios.request(config)
  console.log(res)
  • Lambda runs your code for a set amount of time before timing out. Timeout is the maximum amount of time in seconds that a Lambda function can run. The default value for this setting is 3 seconds Have you checked that? https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html – Kaushal panchal Aug 23 '23 at 05:40
  • I have updated it for 1 min, but still the same response – Rahul Radhakrishnan Aug 23 '23 at 05:43
  • Read this(It says the lambda needs public IP to access the internet): https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the – Prabhakaran Aug 23 '23 at 09:50

0 Answers0