I want to get details of a profile in one of my lambda functions deployed on AWS. Here is the code:
const session = new ApiKeySession(process.env.KLAVIYO_API_KEY as string);
const profilesApi = new ProfilesApi(session);
const filter = 'any(email,["abc@gmail.com"])';
(async () => {
try {
console.log("👹 new api call");
const result = await profilesApi.getProfiles({ filter });
console.log("👹 new data", result.body.data[0].id);
} catch (error) {
console.error("👹 new error", error);
}
})();
It’s very strange that this call times out. I don’t get any response or error. I am sure my lambda has access to Internet since calls to other provider (stripe etc.) APIs is returning successful response. I only see Axios timeout in CloudWatch logs. Here are the CloudWatch logs:
ERROR 👹 new error AxiosError: connect ETIMEDOUT
Any clue what’s going on?